Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change Report Title in code?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Rapports
Divers
Thread ID:
00761816
Message ID:
00761830
Vues:
26
Hi Roland,

Here is how to find the first day of the month:
Dim dateFirstOfMonth As New System.DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, 1, 0, 0, 0)
Here is how to find the last day of the month:
' Returns number of days in the current month
Dim NumDays As Integer = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month)

' Creates a DateTime that is the last day of the current month
Dim dateLastOfMonth = New DateTime(DateTime.Now.Year, DateTime.Now.Month, DaysInMonth(DateTime.Now.Year, DateTime.Now.Month))
To alter the title, you can use the ReportDocument object:
oRpt.SummaryInfo.ReportTitle = "My New Title"
>Hi,
>
>I would like to change the report title in code before calling the Report Viewer. I am using the same report but changing the selection in code.
>
>Also I need to use the first day of the month and the last day of the month Dates. I would like to derive the dates BeginMonthDate & EndMonthDate from GetDate() but cannot find the right VB commands or Functions. I found FirstDayOfWeek but not FirstDayOfMonth.
>
>Looking for somthing like:
>FirstDayOfMonthDate(TimeInterval.Month, GetDate())
>LastDayOfMonthDate(TimeInterval.Month, GetDate())
>
>The code is as follows:
>
>
>Public WithEvents oRpt As ReportDocument
>oRpt = New ExpireList01()
>oRpt.DataDefinition.RecordSelectionFormula = "{Listing.Status} in " & "[" & "'" & "A" & "'," & "'" & "C" & "'," & "'" & "P" & "'] " & "and {Listing.OurListing} and {Listing.MlsOfficeId}='" & sdMlsOfficeId & "'" & " And {Listing.ListingExpireDate} in DateTime (2003, 03, 01, 00, 00, 00) to DateTime (2003, 03, 31, 23, 59, 59)"
>CrystalReportViewer1.ReportSource = oRpt
>
>
>I can find how to change the Report Title using the oRpt.------ above.
>
>Any help would be appreciated!!!
>
>Thanks
>Roland
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform