Showing posts with label details. Show all posts
Showing posts with label details. Show all posts

Tuesday, March 20, 2012

crystal reports (the coder way) ?

Hi

I have a .NET application that needs to obtain the details of the parameters for a crystal report.

I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox.

However, the viewer prompts for the parameters, before i get a chance to get the information and display it.:(

My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ?

Thanks in anticipation[Moved thread]|||YOu need to populate the parameters to the report before viewing it the viewer or printing it to the printer.

here is a sample from VB on how to populate parameters and formulas.

Dim crFormula As CRAXDRT.FormulaFieldDefinition
Dim crParam As CRAXDRT.ParameterFieldDefinition

crReport.DiscardSavedData

For Each crParam In crReport.ParameterFields
Select Case crParam.Name
Case "{?SortType}"
crParam.AddCurrentValue m_strSortType

End Select
Next crParam


For Each crFormula In crReport.FormulaFields
Select Case crFormula.Name
Case "{@.StartDate}"
crFormula.Text = "DATE( 2001, 01, 01)"
Case "{@.EndDate}"
crFormula.Text = "DATE( 2002, 03, 30)"
crFormula.Text = """All Offices"""
Case "{@.DetailOrSummaryFlag}"
crFormula.Text = """" & m_strSummaryDetailFlag & """"
Case "{@.Seperate}"
crFormula.Text = """FALSE"""
Case "{@.SetShowWarning}"
crFormula.Text = """FALSE"""
Case Else
'do nothing
End Select
Next crFormula|||Hi

I have a .NET application that needs to obtain the details of the parameters for a crystal report.

I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox.

However, the viewer prompts for the parameters, before i get a chance to get the information and display it.:(

My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ?

Thanks in anticipation

Dim APP As New CRAXDRT.Application
Dim REPORT As CRAXDRT.Report
REPORT = APP.OpenReport("C:\SHIPMENT_SCHEDULE\REPORTS\XL.rpt")

REPORT.EnableParameterPrompting = False
(this is the one you should include...disabling the parameter prompting)

Crystal Reports - Suppress Section

Hi,

How do one suppress a section if ANOTHER section is suppressed.

The one section holds details such as Name, Surname, Contact Number.
I have insert a "Suppress Blank Section" that will suppress that section if it's blank. However, how do i suppress the OTHER section based on this section.

Suppression Rule: ??

English: Suppress section 1 if section 2 is suppressed

Thanks in advance.Is that another section a GF/GH ?
If yes, yo can suppress it conditionally when:

Count ({table.name}, {table.group_field})=0

Monday, March 19, 2012

Crystal Report queries

In my Crystal Report's Details Section, the blank space after the last line is unnecessarily printed and this disturbs page length settings. How to delete the unnecessary lines below the last text in the Details Section, so that they are not printed as Blank.

I even dragged the dividing line to the last Text Box in the Details section, but the problem persists.

Secondly, when I issue a Print Command, a message box with no text appears. IT's title is "Crystal Reports ActiveX Designer" and an OK button. No other message.Hi,
In the details section set the property of Fit Section(Right click on the left side of Details section, select Fit section). Make sure that page footer does not have empty space.

Madhivanan|||I use CR 8.5, so you may need to tweak my examples a bit if you're using a different version.

1. To suppress the last blank line, go into the Format of that section. Find where you can check Suppress and click the 'x-2' next to it. Enter the following keyword in the formula section: OnLastRecord. This will suppress that section only on the last record.

2. To keep the program from popping up a box when printing, try Report.PrintOut False

Sunday, March 11, 2012

Crystal Report Page Skip Problem

Hello All,

I hav designed a report. It contacins more than 10 records in the details section. Mostly by 10 records the total page will be covered with some headers, so i need to skip the same headers to the next page for other records.

How can i skip to the next page if the Record count is > 10.

bye...

Tks & Rgds,
Poorni.To get at most 10 records per page, put a conditional new page after on the detail section with the formula
recordcound mod 10 = 0

This should be fine if you can be sure that 10 records won't take up more than 1 page.