.NET C# engine port and usage
Report Manager for Dot Net
Basics
The dot net version of Report Manager is a full translation from Delphi to C# of the reporting engine. The port is complete, but some features are still not implemented. Libraries are provided so you can link easily your reports with your application. The .Net native port of the Report Designer is still in progress so, the design and test of the reports are done by the classic designer (32bit or 64bit)
How to design reports for .Net
Design the report normally but:
- Set at page setup, options tab the preferred save method to XML or XML compressed. The .net runtime read and save the reports in this new formats.
- There are small differences, for example when executing in .net, the format property for dates will behave like in .Net framework so the M represents the month and the m the minutes, and the H is the 24 hour format hour.
- For linked queries, the parameters of the child dataset must be defined in Parameters definition and must be assigned to the child dataset.
Missing parts
- Native .net Report Designer is not implemented (Win32/Win64 designer can be used)
- PDF437 barcode is not implemented but QrCode barcodes are available instead(.net only)
- Charting is not implemented
Different behaviour
- In odbc provider you use the ? symbol for placing parameters, the parameters will be assigned by position, not by name, parameters by name are not supported by odbc dot net driver, so make sure to sort the parameters to match query position when you use odbc.
- Format property for expressions use the .net format strings.
Using the library
To use the libraries provided, you should include a reference to them in your project. It' better if you include the .csproj to your project and then a reference to that project so you can debug any problem deeper.
This is sample code to execute a report, a portion of the sample provided testinglib.exe.
using Reportman.Drawing;
using Reportman.Drawing.Forms;
using Reportman.Reporting;
using Reportman.Reporting.Forms;
Report rp=new Reportman.Report();
rp.LoadFromFile(EFile.Text);
rp.ConvertToDotNet();
// Set the provider factory for each database, user the invariant name of the factory (defined in machine.config)
rp.DatabaseInfo[0].ProviderFactory = "YourDatabasefactory";
// As an alternative you can provide an already established connection and transaction
// rp.DatabaseInfo[0].Connection =YourIDBConnection
// rp.DatabaseInfo[0].Transaction=YourIDBTransaction
if (pdf)
{
rp.AsyncExecution=false;
PrintOutPDF printpdf = new PrintOutPDF();
printpdf.FileName=pdffilename;
printpdf.Compressed=compressedpdf;
printpdf.Print(rp.MetaFile);
}
else
{
rp.AsyncExecution=asyncexecution;
if (ParamsForm.ShowParams(rp)
{
PrintOutWinForms prw = new PrintOutWinForms();
prw.Preview = preview;
prw.SystemPreview=systempreview;
prw.ShowPrintDialog=showprintdialog;
prw.Print(rp.MetaFile);
}
}