I am just starting to use Sql 2005 Reporting Services. So far doing trivial things has been easy, but now I want to develop some logic to make my report appear as I want - select images from the database, calculate data for display with complex logic, etc. It would be very easy if a Report had a structure like a web page or a window with a code file attached to the page (or form). This would make it easy to write VB code to respond to events such as Page_Start, Next_Record, etc. However I can't find anything like this - using View Code merely shows the XML definition of the report, which is rather like looking at the source of a web page.
Have I missed the VB (or C#) window, or do I have to figure out how to express all my logic as expressions attached to individual fields?
Thanks,
Robert Barnes
Microsoft.Reporting.WebForms.ReportViewer has abot 10 events you can wire
Microsoft.Reporting.WinForms.ReportViewer has much more
But you can use the viewer and command it from your own controls
|||You can write a custom code for ur reports in SSRS by going to Report properties and then to the code tab... and one ur write the code u can call that piece of code in ur report by code.functionname(and the parameters for it)
Hope this helps
Regards
Karen
|||Karen, that might help when I figure out how to use it. I found the Code tab, but am I writing VB, C#, Javascript, or something else, and into what environment? I'm blundering around here like the proverbial bull in a china shop: can you recommend a tutorial, white paper, or textbook that I should start with? I have been writing ASP Net 2.0 code for about 18 months, so I'm generally happy with ASP Net, SQL, VB, etc, but as always when you start with a new tool the help is hopeless, there's nothing to tell you the basic concepts and how it all hangs together, just lots and lots of unconnected details. If I'm going to make sense of SSRS then I need to get some sort of grounding. For example, ofergal referred to "reportviewer" - what is this and how does it integrate with SSRS with its report designer etc?
i can give u an example as to how u can do it? its like writing a normal VB function...
This a function to change the color of a pie chart in SSRS and i have put this in the Code section...
Private colorPaletteAs String() = {"#1B5693","#E39717","#00623D","#9E0621","#4D207A","#E0861A","#7C154D","#E5A812","#668237","#00626D","#BE4F24","#2C438A"}Private countAs Integer = 0Private mappingAs New System.Collections.Hashtable()Public Function GetColor(ByVal groupingValueAs String)As String If mapping.ContainsKey(groupingValue)Then Return mapping(groupingValue)End If Dim cAs String = colorPalette(countMod colorPalette.Length) count = count + 1 mapping.Add(groupingValue, c)Return cEnd Function
and in the report.. suppose if u wanna call this function in a table... all u got to do is
right this expression in the value or in my case i want to call this function as a background color so all you got to do is call that piece of code like this:
=code.getcolor(fields!RowNumber.Value)
check this link out for more detail on custom codeshttp://www.yukonxml.com/chapters/apress/reportingservices/dotnet/
Report Viewer is way of viewing ur reports using a aspx page.. like suppose if u want the users to run their own reports and u dont want to give direct access to the report server by giving ur credentials. In that case in ur aspx page u can add a control call report viewer and give ur crediatials in the aspx page or the webconfig and ur user can access the reports
Hope this helps.
Regards
Karen
No comments:
Post a Comment