Monday, March 12, 2012

Passing a queryString to RDLC Help

I have this problem. Can someone enlightened me on how to pass a querystring to a rdlc report?

I have a aspx page "Quotation". When my user wants to print out a quotation hardcopy, he will click on an icon (it will go to Quotationhardcopy.aspx which contains the rdlc report) to print out the report. But, I am struck in how to pass the field "QuoteID" to the rdlc report so that it will only print out this quotation belonging to the quoteID..

Can someone advice me on that?

Smile
chankl78

Finally, i solved it. It is so simple & it take me almost 2 days to solve.

Just put the code inside the page Load & it works!!! :cheers:

[CODE]
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim txtQuoteID As Label
Dim paraQuoteID As ReportParameter
Dim QuoteID As Integer

txtQuoteID = fvQuotation.FindControl("QuoteIDLabel")
QuoteID = txtQuoteID.Text
paraQuoteID = New ReportParameter("QuoteID", QuoteID)

Me.rvQuotationHardcopy.LocalReport.SetParameters(New ReportParameter() {paraQuoteID})
End Sub
[/CODE]

No comments:

Post a Comment