Base solution for your next web application

Activities of "dexmox"

The document in their tutorial is correct. Hope this helps for more clarity

These are the steps I use:

Download updated Framework.

Update Node JS - if required Update Yarn - if required update npm "npm install -g npm@latest" - if required SDK's - if required

Steps :

  1. Checkout Framework-Master (this is just a branch with the download extracted from anz page - Usually the last update I did)
  2. Delete all files from Framework-Master and paste new framework base (the updated files from download page)
  3. git add .
  4. git commit -m "Framework 9.3.0 - Initial" (whatever version you downloaded)
  5. git push
  6. Before opening the solution, open a command prompt, navigate to root directory of *.Web.Mvc project and run "yarn" command to install client side dependencies yarn Important Notice: Installing client side npm dependencies using yarn before opening the solution will decrease project opening & building time dramatically.
  7. Open web project build solution
  8. Change appsetting.json db connection string (point to blank db)
  9. Build Solution Web.Mvc
  10. Open terminal to your_project_name\src\your_project_name.EntityFrameworkCore
  11. run database update (dotnet ef database update)
  12. Before running the project, we need to run a npm task to bundle and minify the CSS and JavaScript files. In order to do that, we can open a command prompt, navigate to root directory of *.Web.Mvc project and run "npm run create-bundles" command. This command should be run when a new npm package is being added to the solution.
  13. Run Mvc.Web
  14. Terminal into root folder your_project_name (src folder should be visible).
  15. git add .
  16. git commit -m "Framework 9.3.0 - Working"
  17. git push
  18. Clone a remote branch master and switch to it: git checkout -b Framework-v9.3.0 origin/Framework-Master
  19. Run the Web.Mvc, ensure it launches properly.
  20. Merge master into new Framework-v9.3.0
  21. Resolve conflics

Just putting the solution here for anyone else with this issue.

@ismcagdas said:

It seems like gulp-less doesn't have a solution for this.

We suggest you copy the related css file to your wwwroot folder, change its content (remote related line which starts with Alpha ) and use it instead of using it from node_modules.

As I can see, jquery-ui is not used in AspNet Zero anymore.


Thanks for the help @ismcagdas :) have a great day!

@ismcagdas

Tried Latest LTS Version: 14.17.1 (includes npm 6.14.13) - Failed to build.

Current Version : 6.14.4 (NPM) Node 13.14.0 - Failed to build.

Thanks again.

Hi,

Dont know if this helps you but I had a similar problem back a while ago - I dont use angular though.

However I cant remember exactly what it was - but fixing the script issue fixed that problem.

I think it was to do with Swal (cant be sure though) hope this helps some.

https://support.aspnetzero.com/QA/Questions/7466/Throwing-And-Displaying-UserFriendlyException-Using-abpservicesapp

Hi @ismcagdas,

I've managed to work it out =)

Thanks.

Hi @ismcagdas,

Thanks for getting back to me :)

I have deleted node_modules, tried both npm and yarn seperately - deleted yarn lock and package lock files to ensure clean re-builds.

I clean installed node.js on my work dev machine and it also failed with same error. Reverting to an earlier node.js/npm version on work machine and then running npm run create-bundles completed without error - but did not re-create the jquery-ui.css file).

I downloaded a clean ANZ template and imported the same packages then tried npm run create-bundles and it also failed with same error.

https://support.aspnetzero.com/QA/Questions/9580/How-to-access-the-ASPNET-Zero-private-GitHub-repository

Hi,

Have you checked here ?

Hi All,

Thanks in advance for your time and efforts.

9.3 MVC Core JQuery

Issue: This works on work dev machine but not home office machine and errors out as below. Was working 2 days ago, the package json is the same on both machines. The css file is exactly the same on both machines. Yarn lock has same version of jquery ui dist. bundles are the same on both machines.

It is creating the sample-report.min.css on my work machine - not on my home machine.

I am at a loss as to why it works on one and not the other and how to fix it.

Any help again, is greatly appreciated.

Have a safe and wonderful day.

Added to bundles:

{
 "scripts": [
    {
      "output": "view-resources/Areas/App/Views/_Bundles/sample-report.min.js",
      "input": [
        "node_modules/jquery-ui-dist/jquery-ui.js",
        "node_modules/knockout/build/output/knockout-latest.js",
        "node_modules/devextreme/dist/js/dx.all.js",
        "node_modules/@devexpress/analytics-core/dist/js/dx-analytics-core.js",
        "node_modules/devexpress-reporting/dist/js/dx-webdocumentviewer.js"
      ]
    },
  ....
"styles": [
    {
      "output": "/view-resources/Areas/App/Views/_Bundles/sample-report.min.css",
      "input": [
        "node_modules/jquery-ui-dist/jquery-ui.css",
        "node_modules/devextreme/dist/css/dx.common.css",
        "node_modules/devextreme/dist/css/dx.light.css",
        "node_modules/@devexpress/analytics-core/dist/css/dx-analytics.common.css",
        "node_modules/@devexpress/analytics-core/dist/css/dx-analytics.light.css",
        "node_modules/devexpress-reporting/dist/css/dx-webdocumentviewer.css"
      ]
    },
    ...

added to package.json:

dependencies: [
    "devextreme": "20.2.5",
    "@devexpress/analytics-core": "20.2.5",
    "devexpress-reporting": "20.2.5",
    "jquery-ui-dist": "1.12.1"
]

Error: npm run create bundles:

Bundles are being created, please wait...
[19:51:03] 'buildDev' errored after 5.3 s
[19:51:03] Error in plugin "gulp-less"
Message:
    Could not parse alpha in file C:\*.Web.Mvc\node_modules\jquery-ui-dist\jquery-ui.css line no. 1307
Details:
    type: Syntax
    filename: C:\*.Web.Mvc\node_modules\jquery-ui-dist\jquery-ui.css
    index: 37223
    line: 1307
    column: 23
    callLine: NaN
    callExtract: undefined
    extract:    opacity: .003;, filter: Alpha(Opacity=.3); /* support: IE8 */,}
    lineNumber: 1307
    fileName: C:\*.Web.Mvc\node_modules\jquery-ui-dist\jquery-ui.css
    domainEmitter: [object Object]
    domainThrown: false

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] create-bundles: `yarn && gulp buildDev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] create-bundles script.

Similar / Same Issue : https://stackoverflow.com/questions/54362146/error-in-plugin-gulp-less-could-not-parse-alpha-in-jquery-ui-css

Again, Thank you for your time to read over this.

Following on my above, the only way I can get it to populate a report with data is by:

  • setting the data source manually
  • using a custom query string

There has to be an easier way to achieve my desired outcome right ?

Example scenario again for reference: I want a report for Completed Sales that is filtered by current Tenant and creation time.

If someone could provide a working example that uses a Table Report and queries an SQL Table with a tenantId parameter and date parameter (that is not using a URL using url App/SampleReport?tenantId=2) it would be greatly appreciated.

Updated Controller

public IActionResult CompletedSales()
{           
    return View(CreateReport());        
}
private XtraReport CreateReport()
{
    // Create a new report instance.
    XtraReport report = new CompletedSales();

    // Assign the data source to the report.
    report.DataSource = BindToData();
    report.DataMember = "customQuery";

    return report;
}
private SqlDataSource BindToData()
{
    // Create a data source with the required connection parameters.  
    MsSqlConnectionParameters connectionParameters = new MsSqlConnectionParameters(
        ".\\SQLExpress", "ExampleDb", "sa", "supersecurepassword", MsSqlAuthorizationType.SqlServer);
    SqlDataSource ds = new SqlDataSource(connectionParameters);

    // Create an SQL query to access the Products table.
    CustomSqlQuery query = new CustomSqlQuery();
    query.Name = "customQuery";
    query.Sql = "SELECT * FROM CompletedSales";

    // Add the query to the collection. 
    ds.Queries.Add(query);

    // Make the data source structure displayed  
    // in the Field List of an End-User Report Designer. 
    ds.RebuildResultSchema();

    return ds;
}

Showing 1 to 10 of 49 entries