Crystal Report : How to use Hyperlink for desktop Base program
I am using Crystal Report with C#. For Desktop.
I want to hyperlink to another report with some parameter.
eg. I show In开发者_开发知识库voice's Summary (invoice.rpt) like its number (named InvNo), date, items and TotalAmount. If i click InvNo "0001", then it will passing the InvNo to Item's Summary (item.rpt)
Is it possible?
IF possible, i think it will need some code in crystal report formula, please give me the formula example too.
At first, I thought the answer was 'not possible', but after some experimentation I got farther than I expected.
I created two reports based on the Xtreme.mdb file, named customers.rpt and order.rpt.
The customer.rpt has two columns: Customer Name and Order ID. The order.rpt has three columns: Order ID, Order Date, and Order Amount.
The goal: if I click on the Order ID field in the customers report it opens the order report and generates it for that Order ID.
I added the following to the condition formula associated with the Order ID's Hyperlink:
"file:///C:/Documents and Settings/Administrator/Desktop/order.rpt " + ToText({Orders.Order ID},"#")
When I click on the link, I get the following dialog:
Unfortunately, Crystal Reports' EXE doesn't support command-line arguments, so the action fails:
To get this to work, you would need to create an application that can process the command-line arguments for Crystal Reports. It would have the following characteristics:
- packaged as an EXE
- 'wrap' the Crystal Report Viewer control (you probably don't need any 'design' functionality)
- handle database authentication
- most importantly, it needs to support command-line arguments. in this regard, you could probably model your argument list on BusinessObjecs's URL Reporting.
精彩评论