I see that a request for an example was also made a month ago.
kjkazinski
@kjkazinski
Posts made by kjkazinski
-
RE: Entity Framework Example
-
Entity Framework Example
I have been using the .NET ConsoleApp example as a starting point. I figured I could write a console application that would create all of my reports from a database. I am new to the entity framework and learning C#.
Is there an example using the Entity Framework?
I started by creating a class for my report and a method 'CreateReport'. I have another class for the database context and a class in the models folder (ReportView.cs).
A couple of questions:
-
Do the templates have to be in the jsreport/data/templates/(ReportName) folder or can they be in a jsreport/templates folder? If so, is there a configuration file I need to update?
-
Do I need to use the beforeRender method?
-
How do I pass the DbSet into the RenderByNameAsync method.
The function is below:
''' public bool CreateReport()
{var db = new DBContext(); if (db.Database.Exists() == false) { return false; } Console.WriteLine("Connected to {0}.\n", db.Database.Connection.Database); int ItemCount = db.ReportView.Count(); Console.WriteLine("There are {0,7} entries in the View.", ItemCount.ToString("#,#", CultureInfo.InvariantCulture)); Console.WriteLine("Initializing local jsreport.exe utility"); var rs = new LocalReporting() .RunInDirectory(Path.Combine(Directory.GetCurrentDirectory(), "jsreport")) .KillRunningJsReportProcesses() .UseBinary(JsReportBinary.GetBinary()) .Configure(cfg => cfg.AllowedLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory()) .AsUtility() .Create(); Console.WriteLine("Rendering localy stored template jsreport/data/templates/ReportView into ReportView.pdf"); var ViewReport = rs.RenderByNameAsync("ReportView", db.ReportView).Result; //ViewReport.Content.CopyTo(File.OpenWrite("ReportView.pdf")); return true; }
'''
Thanks.
-
-
RE: API OData Query filter operators not working as expected
From a reconnaissance point of view this is a very powerful command. Is there a way to disable this command in the API?
-
RE: Multicolumn Index Report
Thanks that is a good start for what I am trying to do. How do I put the reference index (C2.2) into the list?
-
Multicolumn Index Report
I am just getting started with JSReport and I am working on creating my first report.
I am trying to create a index format. I have a table with the topics and references that I am pulling the data from.
The report should be a two column report with periods between the topic and references.
Here is a sample of what I am trying to do:
Acceleration ...................................... C2.2
Acceleration, Non-Plotted ... C12.24, D1.2Is there a template to be able to do this?
Thanks in advance.