[dba-VS] Report Generator in VS

Griffiths, Richard R.Griffiths at bury.gov.uk
Wed Apr 8 04:03:58 CDT 2015


Is Crystal Reports for Visual Studio not an option?

Regards

Richard Griffiths
Developer
Tel: 0161 253 5169 
email: r.griffiths at bury.gov.uk
web: www.bury.gov.uk
Bury Council Town Hall Knowsley Street Bury BL9 0SW

-----Original Message-----
From: dba-VS [mailto:dba-vs-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: 06 April 2015 02:39
To: Development in Visual Studio
Subject: Re: [dba-VS] Report Generator in VS

Dan,

I built reports in .Net when I was employed full time, but we used a suite of 3rd party tools, so I haven't really worked with the built in tools much.  Just trying to rewrap my head around them.



Charlotte Foust
(916) 206-4336

On Sun, Apr 5, 2015 at 10:04 AM, Dan Waters <df.waters at outlook.com> wrote:

> Hi Charlotte,
>
>
>
> This is an example of code behind a form which contains a ReportViewer.
> Once you begin learning how to use reports in VS, refer back to this code.
> This is some very hard-earned experience! ;-)
>
>
>
> I’m showing how to pass information to the report form from the 
> calling procedure, and that one form can be designed to display as 
> many different reports as you wish (assuming they all have the same 
> exterior dimensions, i.e., Portrait, Landscape, etc).
>
>
>
> I use LinqToSQL queries as the data access method.  The two variables 
> which begin with ‘LQ’ are those queries.  Of course, you can set up 
> the DataSource with other methods also.
>
>
>
> Good Luck!
>
> Dan
>
>
>
> ‘------------------------------------------------------------
>
>
>
>        Public Sub New(stgNameOfReport As String, Optional stgQueryInfo 
> As String = "", Optional intCellID As Integer = 0)
>
>               MyBase.New()
>
>               InitializeComponent()
>
>               If stgNameOfReport = "" Then Exit Sub
>
>               Me.Text = "Report Data"
>
>               Call ReportList(stgNameOfReport, stgQueryInfo)
>
>        End Sub
>
>        Private Sub ReportList(stgNameOfReport As String, Optional 
> stgQueryInfo As String = "", Optional intID As Integer = 0)
>
>               Dim LQCurrentReport
>
>               Dim stgReportTitle As String = ""
>
>               Dim DCAppMain As New
> DCAppMainDataContext(SV.ConnectionStringServer)
>
>               Dim rds = New ReportDataSource()
>
>               Select Case stgNameOfReport
>
>                     Case "All  Records"
>
>                            stgReportTitle = "All  Records"
>
>                            LQCurrentReport = (From a In 
> DCAppMain.vewStandardReport
>
>                            Select New fakStandardReport With { _
>
>                              .MainID = a.MainID, _
>
>                              .Stage = a.Stage, _
>
>                              .AssessorDate = a.AssessorDate, _
>
>                              .ClosedDate = a.ClosedDate, _
>
>                              .Opportunity = a.Opportunity, _
>
>                              .DueDate = a.DueDate, _
>
>                              .CompletedDate = a.CompletedDate, _
>
>                              .Score = a.Score, _
>
>                              .AceCell = 
> GlobalProcedures.GetAceCellName(a.AceCellID), _
>
>                              .AceCellSub = 
> GlobalProcedures.GetAceCellName(a.AceCellSubID), _
>
>                              .Assessor = 
> PeopleProcedures.GetFullName(a.AssessorID), _
>
>                              .AssignedTo = 
> PeopleProcedures.GetFullName(a.AssignedToID), _
>
>                              .CompletedBy = 
> PeopleProcedures.GetFullName(a.CompletedByID), _
>
>                              .CompletedOpportunity = 
> a.CompletedOpportunity, _
>
>                              .OpportunityID = 
> a.OpportunityID}).ToList()
>
>                            
> Me.FakStandardReportBindingSource.DataSource = LQCurrentReport
>
>
>  ReportViewerTable.LocalReport.ReportEmbeddedResource = 
> "PSIAppMain.rptStandardReport.rdlc"
>
>
>
>                     Case "ScoringDescriptions"
>
>                            stgReportTitle = " Scoring Descriptions"
>
>                            Dim LQScoringDescriptions = From a In 
> DCAppMain.tblExplanations
>
>
>    Order By a.ScoreSort
>
>
>    Select a.ExplanationID, a.ScoreSort, a.Selection, a.Point0Report, 
> a.Point1Report, a.Point2Report, a.Point3Report, a.Point4Report, 
> a.Point5Report
>
>
>  Me.fakScoringDescriptionsBindingSource.DataSource = 
> LQScoringDescriptions
>
>
>  ReportViewerTable.LocalReport.ReportEmbeddedResource = 
> "PSIAppMain.rptScoringDescriptions.rdlc"
>
>               End Select
>
>               rds.Name = "fakStandardReport"
>
>               rds.Value = FakStandardReportBindingSource
>
>               ReportViewerTable.LocalReport.DataSources.Add(rds)
>
>               '-- Set the criteria textboxes on the report
>
>               Dim paramList As New Generic.List(Of ReportParameter)
>
>               paramList.Add(New ReportParameter("ReportTitle", 
> SV.SystemAcronym & " - " & stgReportTitle, True))
>
>               paramList.Add(New ReportParameter("ReportFooter", 
> Utility.ReportFooter, True))
>
>               
> Me.ReportViewerTable.LocalReport.SetParameters(paramList)
>
>               Me.ReportViewerTable.RefreshReport()
>
>               Me.ReportViewerTable.Dock = DockStyle.Fill
>
>        End Sub
>
> ‘---------------------------------------------------------------------
> ---
>
>
>
>
>
> From: dba-VS [mailto:dba-vs-bounces at databaseadvisors.com] On Behalf Of 
> Charlotte Foust
> Sent: Saturday, April 04, 2015 3:57 PM
> To: dba-vs at databaseadvisors.com
> Subject: [dba-VS] Report Generator in VS
>
>
>
> What do you guys use to generate reports in Visual Studio.  I know a 
> lot of people use Crystal Reports, but I hate that option.
>
>
>
>
>
> Charlotte Foust
>
> (916) 206-4336
>
> _______________________________________________
> dba-VS mailing list
> dba-VS at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vs
> http://www.databaseadvisors.com
>
_______________________________________________
dba-VS mailing list
dba-VS at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vs
http://www.databaseadvisors.com
-----------------------------------------------------------------
Why not visit our website www.bury.gov.uk
-----------------------------------------------------------------
Incoming and outgoing e-mail messages are routinely monitored for compliance
with our information security policy.
The information contained in this e-mail and any files transmitted
with it is for the intended recipient(s) alone. It may contain
confidential information that is exempt from the disclosure under
English law and may also be covered by legal,professional or other privilege.
If you are not the intended recipient, you must not copy, distribute or take any
action in reliance on it. 
If you have received this e-mail in error, please notify us immediately by using 
the reply facility on your e-mail system.
If this message is being transmitted over the Internet, be aware that it may be 
intercepted by third parties.
As a public body, the Council may be required to disclose this e-mail or any 
response to it under the Freedom of Information Act 2000 unless the information
in it is covered by one of the exemptions in the Act.  
Electronic service accepted only at legal.services at bury.gov.uk and on fax number 
0161 253 5119 .
*************************************************************



More information about the dba-VS mailing list