3

I need to print invoices from my ASP.NET 4.0 application. I am using RDLC reports.

The invoice is made by: header (customer details, number, date, etc)

details (item description, quantity, price) and if possible... I would like to have rows to separate the colums of the details...

footer, which is the most difficoult part, it contains the totals, and some subreports with list of payment expected, VAT details (I can have different VAT rates and I have to print VAT subtotals).

I couldn't find any tutorial or good solution on the internet...

Till now I found two solutions but both of them are not 100% correct:

1) create a tablix and Group the detail data by invoice id. Add two rows in the tablix, one for header and one for the footer. Add one more tablix for details in the central row. With one page invoices it works fine. But when I have longer invoices there is no way to repeat the header in the second page. In fact, headers are repeated when there is one full instance of details in another page. But in my case I have just one big row with all the details, which is no a full instance, so repeatonnewpage doesn't work.

2) create tablix, create a Group with header and footer. put the invoice header in the Group header, and the invoice footer in the invoice footer. and use the detail row for details. Seems very straightforward... and in this way it repeats the header on any new page. BUT, the footer is just under the last details row. I need it to be at the bottom of the page.

I tried to make the query so I have the right number of rows to fill the page, but this doesn't work either, because each detail rows might consist of more than a row actually, in case it's a long description.

Any suggestion?

a link to an image that is similar to what I want: https://i.stack.imgur.com/4axFt.jpg

1 Answer 1

1

You may not be able to achieve what you want with single report. I have faced same situation but for PDF where user want to export report for multiple user at same time. So i am not sure but may be this will help you.

1) You can create rdlc for single invoice with detail you want and create parameter for Invoice ID in rdlc file.

2) In code file loop over selected invoices and call print method for each invoice separately. Take a look at this walk through for print: Printing a Local Report without Preview

I was exporting pdf so i have combined pdf in each loop and finally one whole pdf get downloaded but you want to print so this may not be possible for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.