Openerp report designer call function from parser - report

I created a report to my object by open office openerp report designer extension,
on my report i need to call the function process, so i need to attach a parser to my report to get my function.
i defined a parser:
how can i attach my parser to the report i creayed, i need my report to be .odt file
Thank you.

please add the following line at the end of your parser.
report_sxw.report_sxw(
'your.report.name',
'your.openerp.model.like.product.product',
'addons/your_module/report/rml_file_name.rml',
parser=notariat_report_contrat,header="external"
)
Thats it. parser is attached with your report.

Related

How to customize test report in nightwatch?

Nightwatch has xml junit report by default, but I need to customize that report and can't find how to do. For example, test report should display count of tests.
You can use the following to generate custom reports in nightwatch using handlebars and nightwatch-html-reporter HTML Report
You can will get the report of in Html.
To get the count in that report you can use any of assertion methods in nightwatch then it should be in the report.
test_runner.js is the file you would edit to customize your tests.

Exporting data from database into pdf in asp.net

I have a lot of tables with lot of rows and columns which I am trying to export into a pdf on a button click in an asp.net webform. This data looks good in a listview. I used iTextSharp, but I couldn't figure out how to export listview to pdf using iTextSharp. So I used datatable and it didn't look very well with iTextSharp. I came across "Spire.DataExport for .NET" but it doesn't seem to be available freely.
Please let me know what's the best way to export a listview into a pdf in asp.net.
UPDATE:
I tried using wkhtmltopdf from codaxy's github link. But even for a simple html line, the conversion is failing from the c# code. Any help on this will be really appreciated, as I have spent a lot of time on this getting nowhere.
c# code:
PdfConvert.ConvertHtmlToPdf(
new PdfDocument { Html = "<html><h1>test</h1></html>" },
new PdfOutput { OutputFilePath = "inline.pdf" }
);
Error::
Server Error in '/JobCosting' Application.
Html to PDF conversion of '-' failed. Wkhtmltopdf output:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: PdfConvertException: Html to PDF conversion of '-' failed. Wkhtmltopdf output:
Source Error:
Line 292: if (process.ExitCode != 0 && !File.Exists(outputPdfFilePath))
Line 293: {
Line 294: throw new PdfConvertException(String.Format("Html to PDF conversion of '{0}' failed. Wkhtmltopdf output: \r\n{1}", document.Url, error));
Line 295: }
Line 296: }
Use wkhtmltopdf from https://wkhtmltopdf.org/
Make HTML from this list control using RenderControl method, and write it fo file, then run that wkhtmltopdf.exe from net using System.Diagnostics.Process class, then it produce pdf file
More answers here Convert HTML to PDF in .NET

Crystal Report File Path

Is it posible to put crystal report file in some site, like :
http://localhost/DocumentRPT/ProductPerTenorByProductID.rpt
And then, I executed with
ReportDocument.load(serverPath)
Or, any suggestion in common publishing method?
Many thanks for the answer.
there is property of report viewer ReportPath you can assign it from code behind
ReportViewertrans.LocalReport.ReportPath = HttpContext.Current.Server.MapPath("Your path to rpt");
or
report.Load(Server.MapPath("Report1.rpt"))

Crystal Reports - Data missing when exporting to (PDF or excel or word)

I'm trying to either print or export some Crystal Reports in asp.net
web application. The reports were made with CR 10.5, get their data
from an SQL Server 2008 database.
When I print or export to PDF, a bunch (but not all) of the fields are
skipped. I've
confirmed that the reports work fine in the viewer and designer, but
not when trying to view or export
1) Some fields are always skipped.
2) The same fields seem to be skipped.
Any suggestion or help is appreciated.
try this...
bind your crystal report viewer in page_init() method or check your page postback event...

c# asp.net report and sub report in report viewer (or reportviewer)

I did all the steps from this waltrought:
http://blogs.msdn.com/b/sqlforum/archive/2011/01/03/walkthrough-add-a-subreport-in-local-report-in-reportviewer.aspx
and when i run it i get the first father report and instead the sub
report i get:
Data retrieval failed for the subreport, 'Subreport5',
located at: C:...
i attach a print screen file
i am using VS2010 framework 3.5.
Can you run the subreport by itself, given the right parameters? If you can't, your problem is that.
If you can run it successfully by itself, double-check that you are passing the parameters correctly to your subreport. Make sure the parameter types match and that you are passing all of them.
Another problem might be that -- if I recall correctly -- when you have a subreport in a local report, you need to provide the data for the subreport programmatically, just as you do with the parent report. There's an event that's raised - SubreportProcessingEvent -- when the subreport is being processed. You write a handler for that event and supply data in the handler. Here's some more information about it: LocalReport.SubReportProcessingEvent. There's a good example on that page.

Resources