Showing posts with label Crystal reports. Show all posts
Showing posts with label Crystal reports. Show all posts
Friday, 16 December 2016
CrystalDecisions Exception
If you get the error
The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception
in your project check the following
What bit your machine is x86 or 64 if 64 set the Target CPU to x86 and make sure you have the runtimes installed for x86
Thursday, 29 May 2014
Datepart in Crystal Reports
Crystal Reports datepart is slightly different than SQL and VB
Interval type Description
yyyy Extracts the year
q Quarter (the result is 1, 2, 3 or 4)
m Month (the result is from 1 to 12)
y Day of year (1 to 365 or 366 in a leap year)
d Day part of the date (1 to 31)
w Day of week (1 to 7 with the result depending on firstDayOfWeek)
ww Week of year (1 to 53 with firstDayOfWeek and firstWeekOfYear determining the exact days of the first calendar week of the year)
h Extracts the hour part of the given DateTime (0 to 23)
n Minute part (0 to 59)
s Second part (0 to 59)
Datepart ("yyyy", your value)
Interval type Description
yyyy Extracts the year
q Quarter (the result is 1, 2, 3 or 4)
m Month (the result is from 1 to 12)
y Day of year (1 to 365 or 366 in a leap year)
d Day part of the date (1 to 31)
w Day of week (1 to 7 with the result depending on firstDayOfWeek)
ww Week of year (1 to 53 with firstDayOfWeek and firstWeekOfYear determining the exact days of the first calendar week of the year)
h Extracts the hour part of the given DateTime (0 to 23)
n Minute part (0 to 59)
s Second part (0 to 59)
Datepart ("yyyy", your value)
Thursday, 8 May 2014
Shade Alternate Lines
Repost from Crystal Report Tips and Trick This was very useful and simple.
Shading Alternate Details Lines
- Right-click the Details section name.
- Select Section Expert.
- Click the color tab and click the Conditional Formatting button.
- To shade every other line, enter the formulaIf RecordNumber Mod 2 = 0 Then crSilver else crNoColorTo shade every two lines, enter the formulaIf RecordNumber Mod 4 in 1 to 2 Then crSilver else crNoColor
- Click OK twice, and preview your report.
Wednesday, 23 April 2014
Export Crystal report to PDF
Please see below code on how to export a crystal report as a PDF file without using a viewer.
Dim filename As String filename ="c:\labels.pdf" Dim cryRpt As New ReportDocument cryRpt.Load("c:\labesbooked.rpt") Try Dim CrExportOptions As ExportOptions Dim CrDiskFileDestinationOptions As New _ DiskFileDestinationOptions() Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions() CrDiskFileDestinationOptions.DiskFileName = filename CrExportOptions = cryRpt.ExportOptions With CrExportOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat .DestinationOptions = CrDiskFileDestinationOptions .FormatOptions = CrFormatTypeOptions End With cryRpt.Export() Catch ex As Exception 'do somthing End Try
Wednesday, 13 February 2013
Hide show field on text value Crystal Reports
Need to suppress a field in Crystal Reports when a filed contains part of some text like
"Get some Text" and you need to suppress the field when it says "text" then in the field to be suppressed
"Get some Text" and you need to suppress the field when it says "text" then in the field to be suppressed
- goto format text
- check suppress
- Click x-s
- add InStr ({field name},'text' )>0
This will hide show the field when "text" is present
if there is more then one line say in the body then add
or
InStr (previous ({filed name}),'text' )>0
Change the 0 to 1 or -1 as appropriate to hide or show depending on what match is made by instr()
Subscribe to:
Posts (Atom)
Multi Point USB Charger
USB Plug Charger, 4-Port USB Fast Charger Plug with 33W Intelligent Quick Charge 3.0 Wall Charger, Multi USBPower Adapter UK Fast Charging...
-
USB Plug Charger, 4-Port USB Fast Charger Plug with 33W Intelligent Quick Charge 3.0 Wall Charger, Multi USBPower Adapter UK Fast Charging...
-
Today, emergencies happen often. Below is a list of emergency supplies that you should have available. This list is not made in stone. For...
-
If you have a Samsung phone or pad and the keyboard is set to Google give the Samsung one a try. Just go into the keyboard settings and...