Hi,
1/ dntcaptcha not working on the existing Abp Project
Can you share the error logs?
2/ Unable to find package Volo.Abp.EntityFrameworkCore.Oracle with version (>=5.0.0)
See https://github.com/abpframework/abp/issues/10957, we will publish the Nuget Package soon.
I am sorry to reply you late. 1/ By the way relating to DNTCaptcha, it does not show the image number when i upgrade to latest version. Currently i use the version 4.1.0 (which it is working). I will retest with the new version Volo.Abp.EntityFrameworkCore.Oracle and dotnet 6
2/ About the new version Volo.Abp.EntityFrameworkCore.Oracle, do you have any update? 3/ Right now i am facing with this error after running dotnet ef migrations add Created_Table_Entity Failed to initialize CoreCLR, HRESULT: 0x80004005
It is not working smoothly like before. Could you help ? Please note: I am developing on Visual Studion for Macbook and it had been working normally when i run " dotnet ef migrations add Created_Table_Entity"
@liangshiwei: I can fix now the problem with Failed to initialize CoreCLR, HRESULT: 0x80004005 By the way, right now in order to run add migrations and database update, i have to run use the following command:
myname@MacBook-Pro MyProject.EntityFrameworkCore% dotnet ef migrations add Created_Table_Entity --startup-project ../MyProject.Web --project ../MyProject.EntityFrameworkCore.DbMigrations -c MyProjectMigrationsDbContext
myname@MacBook-Pro MyProject.EntityFrameworkCore % dotnet ef database update --startup-project ../MyProject.Web --project ../MyProject.EntityFrameworkCore.DbMigrations -c MyProjectMigrationsDbContext
But it is OK because i can make my project working. However, I'd like to know the availability of the new version of Volo.Abp.EntityFrameworkCore.Oracle working with dotnet 6, so i can update my current ABP to the version 5 with dotnet 6 again; after that I will retest my application with DNTCaptcha and other dependencies.
Thanks Happy Christmas
Hi,
1/ dntcaptcha not working on the existing Abp Project
Can you share the error logs?
2/ Unable to find package Volo.Abp.EntityFrameworkCore.Oracle with version (>=5.0.0)
See https://github.com/abpframework/abp/issues/10957, we will publish the Nuget Package soon.
I am sorry to reply you late. 1/ By the way relating to DNTCaptcha, it does not show the image number when i upgrade to latest version. Currently i use the version 4.1.0 (which it is working). I will retest with the new version Volo.Abp.EntityFrameworkCore.Oracle and dotnet 6
2/ About the new version Volo.Abp.EntityFrameworkCore.Oracle, do you have any update? 3/ Right now i am facing with this error after running dotnet ef migrations add Created_Table_Entity Failed to initialize CoreCLR, HRESULT: 0x80004005
It is not working smoothly like before. Could you help ? Please note: I am developing on Visual Studion for Macbook and it had been working normally when i run " dotnet ef migrations add Created_Table_Entity"
After Upgrading to ABP Version5 and dotnet6, I have the following problems: 1/ dntcaptcha not working on the existing Abp Project It was working fine with the Abp version 4.4 and botnet 5, but now It does not show captcha image
2/ Unable to find package Volo.Abp.EntityFrameworkCore.Oracle with version (>=5.0.0) I update the Abp Suite and I run abp suite to create a new complete application using with Oracle. After creating the application successfully, I open it in the Visual Studio for Mac (Preview) and it starts to resolve my application. It shows errors Unable to find package Volo.Abp.EntityFrameworkCore.Oracle with version (>=5.0.0) In the Nuget, the latest version is 4.4.4. I tried to install this version but It fails because (I think) it might be this reason: .EntityFrameworkCore -> Volo.Abp.EntityFrameworkCore.Oracle 4.4.4 -> Oracle.EntityFrameworkCore 5.21.3 -> Microsoft.EntityFrameworkCore.Relational (>= 5.0.6 && < 6.0.0). Checking compatibility of packages on net6.0.
Please note: I am using Visual Studio for Mac (Preview) because of the botnet 6 installed.
Hi,
Sorry I'm late, I'm just on vacation.
It looks like you are createing CSV files in the JS, I think there is no problem.
But you want export Excel instead of CSV, you need to return file stream in the
Controller
.Example:
public IActionResult ExportExcel() { string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; string fileName = "Report.xlsx"; var workbook = new XLWorkbook(); IXLWorksheet worksheet = workbook.Worksheets.Add("sheet1"); //..... using (var stream = new MemoryStream()) { workbook.SaveAs(stream); var content = stream.ToArray(); return File(content, contentType, fileName); } }
Hi,
Thanks so much
@liangshiwei Sorry to ask you to verify it. May be you don't want to response. You can close this question now.
Hi,
Can you check the article? https://tsafadi.medium.com/download-a-file-with-asp-net-core-e23e8b198f74
Thanks for the link. I dont follow it, because my coding follows https://docs.abp.io/en/commercial/latest/samples/easy-crm , I copy code from google to use it in javascript. Please recommend whether it is a good practice or not. Here is my code:
$("#exportButton").click(function (e) {
dashboardService.getWeeklyTop5({
startDate: _latestFilters.startDate,
endDate: _latestFilters.endDate
}).then(function (statistic) {
const data = JSON.stringify(statistic);
var columns = ['name', 'total'];
var rows = JSON.parse(data).map(function (obj) {
return columns.map(function (key) {
return obj[key];
});
});
rows.unshift(columns);
var processRow = function (row) {
var finalVal = '';
for (var j = 0; j < row.length; j++) {
var innerValue = row[j] === null ? '' : row[j].toString();
if (row[j] instanceof Date) {
innerValue = row[j].toLocaleString();
};
var result = innerValue.replace(/"/g, '""');
if (result.search(/("|,|\n)/g) >= 0)
result = '"' + result + '"';
if (j > 0)
finalVal += ',';
finalVal += result;
}
return finalVal + '\n';
};
var csvFile = '';
for (var i = 0; i < rows.length; i++) {
csvFile += processRow(rows[i]);
}
var blob = new Blob([csvFile], { type: 'text/csv;charset=utf-8;' });
if (navigator.msSaveBlob) { // IE 10+
navigator.msSaveBlob(blob, filename);
} else {
var link = document.createElement("a");
if (link.download !== undefined) { // feature detection
// Browsers that support HTML5 download attribute
var url = URL.createObjectURL(blob);
link.setAttribute("href", url);
link.setAttribute("download", "WeeklyTop5");
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
});
});
Hi,
My understanding may not be correct, please let me know if yes.
You can bind the click event of the button, just an example:
... $("#exportButton").click(function(){ window.location.href = "/api.." }) ...
Hi, that button event click is working. Thank you. By the way, I expected to use ClosedXML but it seems that i have to use javascript in order to export excel or CSV. Do you have a sample to do that in Javascript?
dashboardService.getWeeklyTop5BundlesPurchased({ startDate: filters.startDate, endDate: filters.endDate }).then(function (statistic) {
**----> How to get data and export to CSV or excel file ? ** });
Hi,
My understanding may not be correct, please let me know if yes.
You can bind the click event of the button, just an example:
... $("#exportButton").click(function(){ window.location.href = "/api.." }) ...
Let me try and will come back to you
This is my current JS. How can I make it work with button and export data to excel?
(function () {
var l = abp.localization.getResource("Dashboard");
var colors = ["#36A2EB", "#111111", "#FFCE56", "#4BC0C0", "#FF6384"];
abp.widgets.WeeklyTop5BundlesRenewPieChartWidget = function ($wrapper) {
var _chart;
var dashboardService = dashboard.bundleSubscs.bundleSubsc;
var refresh = function (filters) {
dashboardService.getWeeklyTop5BundlesPurchased({
startDate: filters.startDate,
endDate: filters.endDate
}).then(function (statistic) {
_chart.data = {
datasets: [
{
data: statistic.map(x => x.totalSubscription),
backgroundColor: colors.slice(0, statistic.length),
label: l('Total'),
fill: true
}
],
labels: statistic.map(x => x.name)
};
_chart.update();
});
};
var init = function (filters) {
_chart = new Chart($wrapper.find('.WeeklyTop5BundlesRenewPieChart'),
{
plugins: ['ChartDataLabels'],
type: 'pie',
options: {
tooltips: {
enabled: false,
},
plugins: {
datalabels: {
color: '#ffffff',
textAlign: 'center',
font: {
lineHeight: 1.6
},
formatter: function (value, ctx) {
alert(ctx);
return ctx.chart.data.labels[ctx.dataIndex] + '\n' + value + '%';
}
}
}
},
});
refresh(filters);
};
return {
init: init,
refresh: refresh
};
};
})();