Sunday, March 11, 2012

CR as blank report

1. is it possible to create just blank report and pass the value for it via VB?

2. is it possible that in that blank report i want to use ORDER BY certain condition that determined by condition that user want..ex : by date, by supplier, etc

can anyone explain me how to do it..
thx..Why would you want to design a report that has no fields and no data connection?
You use Crystal to establish the data structures used by the report, and how they will be grouped, etc.
How do you propose to test the report to ensure that it work properly, if you don't design it first?

dave|||thx springsoft
sorry for my unclear question

until now..i always use CR to design the report..like what field to display, connection, group by, etc..and i just use vb just to call the report to display (FYI : i'm using just CR control in VB)..using selectionformula which i realize it's took some time if there's alot record..i'm planning using recordset and pass it to CR so that the value is just came from my query in VB (not take some time anymore to display since the 'selection' thing already done at my query)..is it true what i assuming? or is there any better method??

a couple days ago..i read about to 'code' CR with VB (maybe like using ADODC and ADODB in VB) but i don't understand how to do it in VB..

what i mean blank report is..i created report in CR that just use ParameterField..and fill its value from VB..so whenever someone open .rpt..it only show 'blank' report..

now..i'm gonna use CR to display a record that exactly from same table..but different in 'ORDER BY' thing..if i'm using 'old' way..i'm gonna make a several report for several ORDER BY..this isn't a good way
since i'm new at this point..could u or anyone suggest or guide me how to do this and other stuff..

hope u understand what i'm saying
thx|||See my post in this link:

http://www.dev-archive.com/forum/showthread.php?t=309534&highlight=ado|||thx malleyo
that's not what i mean but it certainly can be useful for me

let me clarify my question
first i create a .rpt using CR which the value in detail section will be from parameter field that i pass later through VB

so the question will be..
1. if i use parameter field..can the .rpt be sort by or group by certain field that controlled by my VB app?so i don't need to create alot .rpt if the sort condition is alot too
is it possible to do that? any suggestion how i do it?

thx|||What about this:

The following code can be used to decide the sort order of your rows through VB Code:

1. First, In Crystal Reports, create a Formula Field and add 1 column (a String column works best).
2. Insert a Group and choose your Formula for the GroupBy.
3. Now, you can comment out the Column you entered, or you can leave it there, your choice.
4. In VB, add this line of code, substituting {ttxFileName.ColumnName} for the column you want to sort by: Report.FormulaFields(1).Text = "{ttxFileName.ColumnName} ". The FormulaFields can only take a long for the index, so you need to know what number your Formula is so you don't replace the wrong one. The numbers start at 1 and are incremented based on the order the formulas were created (they are listed in chronological order).

NOTE: This example works with CR 8.5 and VB6, you may have to tweak it a bit if you're using different versions.|||thx malleyo
sorry for late reply..coz it's holiday here and i don't have internet at home :)
so that's how it works for ORDER BY problem..

still have another problem..
i'm want to restricted .rpt just to display certain record like SupplierID = 'Erick'
1. is it the same way as previous just different at record/group selection formula section?
2. can it be done using same report as previous so that i'm not working with alot of .rpt?
3. a couple weeks ago..i realized that using .selectionformula method is not a good way to display certain data(like just display where SupplierID = 'Erick')..any suggestion for this one?

thanks|||If you only want to display certain criteria, use a conditional suppress.

To specify the condition at runtime, create a formula like you did from my previous post. Like this:
'Erick'
Then set the Conditional Suppress for the field or section you want to suppress. Like this:
{FieldName} <> {FormulaYouCreated}

Whenever the FieldName matches what you plugged into the formula from VB, the field will be displayed.

An alternative is to set the {FormulaYouCreated} to this:
{FieldName} <> 'Erick'
and the Conditional Suppress formula to this:
{FormulaYouCreated}

If you do it the second way, you can leave the {FormulaYouCreated} blank and it will display all the records.

Doing it the second way, this will show only records for 'Erick':
Report.FormulaFields(1).Text = "{FieldName} <> 'Erick' "

Doing it the second way, this will show all records:
Report.FormulaFields(1).Text = "//Comment as Placeholder"

Doing it the second way, this will show records for everyone EXCEPT 'Erick':
Report.FormulaFields(1).Text = "{FieldName} = 'Erick' "|||thx alot malleyo

i have to give it a try about this one..

No comments:

Post a Comment