简体   繁体   中英

Dynamically Report Preview

Is there any way to populate the report viewer Dynamically (only labels)?, i what to make a little process where the users can define the label and position on the report, for example:

A)User pick this 2 fields: 1)Beneficiary Name 2) Amount of the payment

B) User pick the position of each label (or better with a drag/drop) 1)Beneficiary: Heigth = 30, width = 200, x = 20, y = 60 2)Amount: Heigth = 30, width = 80, x = 400, y = 60

C) We populate the report viewer so the user can see how his report is going to print.

Once the user save is report and want to print a Check/Payment, by code we only are going to take the label and position and send it to the print directly ("p.print()") not with a ReportViewer control, i only want the report viewer so the user can see how their report will see before printing it (position preview), or there another way to do this?.

I hope you get my idea of what a want to do here, thanks in advance.

(i use an example of 2 fields, the user will select between 30 to 40 different field)

The report definition is simply a XML file (text). As part of your report generate/run process, you could alter the contents of the .rdl file

  1. Start by making a report template that has your fields on the report (with default positions).
  2. Before you run the report, read template, replace (reposition or hide) those fields, save copy under a temp name.
  3. Use your report viewer to run the (modified) copy.

I'm not saying it will be easy though. Your requirements sound tough. The drag/drop resizing and add/removing controls (that you described) would probably have to be done using some pretty slick JQuery. There are plenty of nice examples of that kind of thing (goog).

Take a look at ReportBuilder . It allows user to create adhock reports on the fly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM