Generate an invoice programmatically?

This relates to rendering Reports\Invoice.rdlc report file for the Avontus.Rental.UI.exe application.

Is there any example code available to generate an invoice and save it off as PDF using the Quantify API directly?

We believe the correct approach is to use the Avontus.Quantify.Reports.dll for this. If this is correct could you please include sample code to generate and save an invoice PDF for the InvoiceDetailed, InvoiceWithRentLines and InvoiceWithRentLinesLandscape reports in the Avontus.Quantify.Reports.dll.

  • OR *

If this is not the correct approach, could you please provide the appropriate sample code and guidance on how to do this?

Hello Matthew. Unfortunately the PDF creation of the reports is in the layer above the API, so PDF’s cannot be sent from here. The Avontus.Quantify.Reports.dll is also used by the UI for the custom reports. Sorry to be the bearer of bad news :frowning: .

After further research it appears that the reports utilized in Quantify are DevExpress reports v18.4.2. Could you please provide a code sample on how to pull the data for the Detailed invoice report using the Quantify API and the code needed to save the report to pdf using the DevExpress reporting engine?

Hi Matthew. The reporting engine isn’t exposed through our API. I’m not sure that we are able to make this work for you as there’s a lot of logic in the reports that’s handled before they’re rendered. Your end-users can save reports and can save multiple in one shot and maybe place them on a drive where you can access them?

PCG has been able to generate and export detailed invoices PDFs using the attached code. Could a developer from Avontus please review this logic, and verify that we are on the right track for this part of our integration?

GenerateReportTest.zip (478.2 KB)

Hi Matthew. That looks pretty cool, very innovative approach!