Print contents of VB grid into Crystal Report?
Author |
Message |
Aidan Field #1 / 17
|
 Print contents of VB grid into Crystal Report?
Hey, I've queried an Oracle databse thru a VB application and displayed the results into a MSHFlexGrid, and I need to be able to print these results off into a Crystal Report. However, the parameters that bring back this info are going to be different every time, so I'll have to specify them on the fly. Any suggestions would be appreciated. Thanks.
|
Sun, 03 Apr 2005 21:41:17 GMT |
|
 |
CW #2 / 17
|
 Print contents of VB grid into Crystal Report?
You simply specify record selection formula at run time.
Quote: > Hey, > I've queried an Oracle databse thru a VB application and displayed the > results into a MSHFlexGrid, and I need to be able to print these results off > into a Crystal Report. > However, the parameters that bring back this info are going to be different > every time, so I'll have to specify them on the fly. > Any suggestions would be appreciated. > Thanks.
|
Mon, 04 Apr 2005 18:29:23 GMT |
|
 |
Aidan Field #3 / 17
|
 Print contents of VB grid into Crystal Report?
Thanks for answering ... I have specified a search string for record selection at run time: With frmCrystal.CrystalReport1 .SelectionFormula = strSQLString .Destination = crptToPrinter .ReportSource = crptReport .ReportFileName = strFileName .WindowState = crptMaximized .Action = 1 End With My problem is, (I think), interpreting the search results within crystal. I'm getting the following Error Message: Error Number 20515 Error Description: Error In Formula <Record_Selction> The remaining text does not appear to be part of the formula. The query runs correctly against the database, so I must be doing something wrong within Crystal. What is the correct way to pass this Search string in to crystal for display? Any help would be greatly appreciated.
Quote: > You simply specify record selection formula at run time.
> > Hey, > > I've queried an Oracle databse thru a VB application and displayed the > > results into a MSHFlexGrid, and I need to be able to print these results > off > > into a Crystal Report. > > However, the parameters that bring back this info are going to be > different > > every time, so I'll have to specify them on the fly. > > Any suggestions would be appreciated. > > Thanks.
|
Sat, 09 Apr 2005 18:31:25 GMT |
|
 |
CW #4 / 17
|
 Print contents of VB grid into Crystal Report?
What's value of strSQLString?
Quote: > Thanks for answering ... > I have specified a search string for record selection at run time: > With frmCrystal.CrystalReport1 > .SelectionFormula = strSQLString > .Destination = crptToPrinter > .ReportSource = crptReport > .ReportFileName = strFileName > .WindowState = crptMaximized > .Action = 1 > End With > My problem is, (I think), interpreting the search results within crystal. > I'm getting the following Error Message: > Error Number 20515 > Error Description: Error In Formula <Record_Selction> The remaining text > does not appear to be part of the formula. > The query runs correctly against the database, so I must be doing something > wrong within Crystal. What is the correct way to pass this Search string in > to crystal for display? > Any help would be greatly appreciated.
> > You simply specify record selection formula at run time.
> > > Hey, > > > I've queried an Oracle databse thru a VB application and displayed the > > > results into a MSHFlexGrid, and I need to be able to print these results > > off > > > into a Crystal Report. > > > However, the parameters that bring back this info are going to be > > different > > > every time, so I'll have to specify them on the fly. > > > Any suggestions would be appreciated. > > > Thanks.
|
Sat, 09 Apr 2005 18:44:07 GMT |
|
 |
CW #5 / 17
|
 Print contents of VB grid into Crystal Report?
Give me an example of the value where it gives you error you mentioned in your last post. I am sure the error is due the value you have passed in the report. It's hard to troubleshoot without knowing some examples.
Quote: > The value of the SQLString is not constant - it depends on what variables > the user wants to use to populate the Grid in VB - that they want to be able > to print off, so it will be different every time.
> > What's value of strSQLString?
> > > Thanks for answering ... > > > I have specified a search string for record selection at run time: > > > With frmCrystal.CrystalReport1 > > > .SelectionFormula = strSQLString > > > .Destination = crptToPrinter > > > .ReportSource = crptReport > > > .ReportFileName = strFileName > > > .WindowState = crptMaximized > > > .Action = 1 > > > End With > > > My problem is, (I think), interpreting the search results within > crystal. > > > I'm getting the following Error Message: > > > Error Number 20515 > > > Error Description: Error In Formula <Record_Selction> The remaining > text > > > does not appear to be part of the formula. > > > The query runs correctly against the database, so I must be doing > > something > > > wrong within Crystal. What is the correct way to pass this Search > string > > in > > > to crystal for display? > > > Any help would be greatly appreciated.
> > > > You simply specify record selection formula at run time.
> > > > > Hey, > > > > > I've queried an Oracle databse thru a VB application and displayed > the > > > > > results into a MSHFlexGrid, and I need to be able to print these > > results > > > > off > > > > > into a Crystal Report. > > > > > However, the parameters that bring back this info are going to be > > > > different > > > > > every time, so I'll have to specify them on the fly. > > > > > Any suggestions would be appreciated. > > > > > Thanks.
|
Sat, 09 Apr 2005 21:36:18 GMT |
|
 |
Aidan Field #6 / 17
|
 Print contents of VB grid into Crystal Report?
The value of the SQLString is not constant - it depends on what variables the user wants to use to populate the Grid in VB - that they want to be able to print off, so it will be different every time.
Quote: > What's value of strSQLString?
> > Thanks for answering ... > > I have specified a search string for record selection at run time: > > With frmCrystal.CrystalReport1 > > .SelectionFormula = strSQLString > > .Destination = crptToPrinter > > .ReportSource = crptReport > > .ReportFileName = strFileName > > .WindowState = crptMaximized > > .Action = 1 > > End With > > My problem is, (I think), interpreting the search results within crystal. > > I'm getting the following Error Message: > > Error Number 20515 > > Error Description: Error In Formula <Record_Selction> The remaining text > > does not appear to be part of the formula. > > The query runs correctly against the database, so I must be doing > something > > wrong within Crystal. What is the correct way to pass this Search string > in > > to crystal for display? > > Any help would be greatly appreciated.
> > > You simply specify record selection formula at run time.
> > > > Hey, > > > > I've queried an Oracle databse thru a VB application and displayed the > > > > results into a MSHFlexGrid, and I need to be able to print these > results > > > off > > > > into a Crystal Report. > > > > However, the parameters that bring back this info are going to be > > > different > > > > every time, so I'll have to specify them on the fly. > > > > Any suggestions would be appreciated. > > > > Thanks.
|
Sat, 09 Apr 2005 20:45:27 GMT |
|
 |
Aidan Field #7 / 17
|
 Print contents of VB grid into Crystal Report?
This is one example, although not the most complex. In filling the grid the user could be querying up to 4 separate tables. In the example below only 2 tables are queried: SELECT C.CERTIFICATE_NO, W.ORDER_NO, C.CERTIFICATE_TYPE, W.JOB_NO, W.CONTRACT_NO, W.CONTRACT_REFERENCE, C.DETAILS_OF_PART_COMPLETION, C.ISSUED_BY, C.DATE_ISSUED, C.ISSUE_COMMENTS, C.SENT_TO_FOR_ISSUE, C.COMPLETION_DATE, C.VALUE_OF_PART_COMPLETION, C.ENTERED_BY, C.CONT_ISSUE_STATUS, C.REVISED_CONT_ISSUE_DATE, C.CLIENT_ISSUE_STATUS, C.REVISED_CLIENT_ISSUE_DATE FROM CERTIFICATE_OF_COMPLETION C, WORKORDER W WHERE W.ORDER_NO = C.ORDER_NO AND C.ISSUED_BY LIKE 'TEST1%' Is there something specific I should be doing on the Crystal Report, e.g. with the "Edit Selection Formula" option? I'm not sure how the Report is translating the sqlstring I'm passing across. Thanks.
Quote: > Give me an example of the value where it gives you error you mentioned in > your last post. I am sure the error is due the value you have passed in the > report. It's hard to troubleshoot without knowing some examples.
> > The value of the SQLString is not constant - it depends on what variables > > the user wants to use to populate the Grid in VB - that they want to be > able > > to print off, so it will be different every time.
> > > What's value of strSQLString?
> > > > Thanks for answering ... > > > > I have specified a search string for record selection at run time: > > > > With frmCrystal.CrystalReport1 > > > > .SelectionFormula = strSQLString > > > > .Destination = crptToPrinter > > > > .ReportSource = crptReport > > > > .ReportFileName = strFileName > > > > .WindowState = crptMaximized > > > > .Action = 1 > > > > End With > > > > My problem is, (I think), interpreting the search results within > > crystal. > > > > I'm getting the following Error Message: > > > > Error Number 20515 > > > > Error Description: Error In Formula <Record_Selction> The remaining > > text > > > > does not appear to be part of the formula. > > > > The query runs correctly against the database, so I must be doing > > > something > > > > wrong within Crystal. What is the correct way to pass this Search > > string > > > in > > > > to crystal for display? > > > > Any help would be greatly appreciated.
> > > > > You simply specify record selection formula at run time.
> > > > > > Hey, > > > > > > I've queried an Oracle databse thru a VB application and displayed > > the > > > > > > results into a MSHFlexGrid, and I need to be able to print these > > > results > > > > > off > > > > > > into a Crystal Report. > > > > > > However, the parameters that bring back this info are going to be > > > > > different > > > > > > every time, so I'll have to specify them on the fly. > > > > > > Any suggestions would be appreciated. > > > > > > Thanks.
|
Sat, 09 Apr 2005 23:14:29 GMT |
|
 |
CW #8 / 17
|
 Print contents of VB grid into Crystal Report?
strSQL is the value you are passing to selection formula. However, you are passing a SQL query string! selection formula would have content such as "{mytable.myfield} = 1"
Quote: > This is one example, although not the most complex. In filling the grid the > user could be querying up to 4 separate tables. In the example below only 2 > tables are queried: > SELECT > C.CERTIFICATE_NO, W.ORDER_NO, C.CERTIFICATE_TYPE, W.JOB_NO, > W.CONTRACT_NO, W.CONTRACT_REFERENCE, C.DETAILS_OF_PART_COMPLETION, > C.ISSUED_BY, C.DATE_ISSUED, C.ISSUE_COMMENTS, C.SENT_TO_FOR_ISSUE, > C.COMPLETION_DATE, C.VALUE_OF_PART_COMPLETION, C.ENTERED_BY, > C.CONT_ISSUE_STATUS, C.REVISED_CONT_ISSUE_DATE, C.CLIENT_ISSUE_STATUS, > C.REVISED_CLIENT_ISSUE_DATE > FROM CERTIFICATE_OF_COMPLETION C, WORKORDER W > WHERE W.ORDER_NO = C.ORDER_NO AND C.ISSUED_BY LIKE 'TEST1%' > Is there something specific I should be doing on the Crystal Report, e.g. > with the "Edit Selection Formula" option? I'm not sure how the Report is > translating the sqlstring I'm passing across. > Thanks.
> > Give me an example of the value where it gives you error you mentioned in > > your last post. I am sure the error is due the value you have passed in > the > > report. It's hard to troubleshoot without knowing some examples.
> > > The value of the SQLString is not constant - it depends on what > variables > > > the user wants to use to populate the Grid in VB - that they want to be > > able > > > to print off, so it will be different every time.
> > > > What's value of strSQLString?
> > > > > Thanks for answering ... > > > > > I have specified a search string for record selection at run time: > > > > > With frmCrystal.CrystalReport1 > > > > > .SelectionFormula = strSQLString > > > > > .Destination = crptToPrinter > > > > > .ReportSource = crptReport > > > > > .ReportFileName = strFileName > > > > > .WindowState = crptMaximized > > > > > .Action = 1 > > > > > End With > > > > > My problem is, (I think), interpreting the search results within > > > crystal. > > > > > I'm getting the following Error Message: > > > > > Error Number 20515 > > > > > Error Description: Error In Formula <Record_Selction> The remaining > > > text > > > > > does not appear to be part of the formula. > > > > > The query runs correctly against the database, so I must be doing > > > > something > > > > > wrong within Crystal. What is the correct way to pass this Search > > > string > > > > in > > > > > to crystal for display? > > > > > Any help would be greatly appreciated.
> > > > > > You simply specify record selection formula at run time.
> > > > > > > Hey, > > > > > > > I've queried an Oracle databse thru a VB application and > displayed > > > the > > > > > > > results into a MSHFlexGrid, and I need to be able to print these > > > > results > > > > > > off > > > > > > > into a Crystal Report. > > > > > > > However, the parameters that bring back this info are going to > be > > > > > > different > > > > > > > every time, so I'll have to specify them on the fly. > > > > > > > Any suggestions would be appreciated. > > > > > > > Thanks.
|
Sun, 10 Apr 2005 17:43:48 GMT |
|
 |
Aidan Field #9 / 17
|
 Print contents of VB grid into Crystal Report?
Are you saying that I can't pass SQL query into Crystal for it to display the results?
Quote: > strSQL is the value you are passing to selection formula. However, you are > passing a SQL query string! > selection formula would have content such as "{mytable.myfield} = 1"
> > This is one example, although not the most complex. In filling the grid > the > > user could be querying up to 4 separate tables. In the example below only > 2 > > tables are queried: > > SELECT > > C.CERTIFICATE_NO, W.ORDER_NO, C.CERTIFICATE_TYPE, W.JOB_NO, > > W.CONTRACT_NO, W.CONTRACT_REFERENCE, C.DETAILS_OF_PART_COMPLETION, > > C.ISSUED_BY, C.DATE_ISSUED, C.ISSUE_COMMENTS, C.SENT_TO_FOR_ISSUE, > > C.COMPLETION_DATE, C.VALUE_OF_PART_COMPLETION, C.ENTERED_BY, > > C.CONT_ISSUE_STATUS, C.REVISED_CONT_ISSUE_DATE, C.CLIENT_ISSUE_STATUS, > > C.REVISED_CLIENT_ISSUE_DATE > > FROM CERTIFICATE_OF_COMPLETION C, WORKORDER W > > WHERE W.ORDER_NO = C.ORDER_NO AND C.ISSUED_BY LIKE 'TEST1%' > > Is there something specific I should be doing on the Crystal Report, e.g. > > with the "Edit Selection Formula" option? I'm not sure how the Report is > > translating the sqlstring I'm passing across. > > Thanks.
> > > Give me an example of the value where it gives you error you mentioned > in > > > your last post. I am sure the error is due the value you have passed in > > the > > > report. It's hard to troubleshoot without knowing some examples.
> > > > The value of the SQLString is not constant - it depends on what > > variables > > > > the user wants to use to populate the Grid in VB - that they want to > be > > > able > > > > to print off, so it will be different every time.
> > > > > What's value of strSQLString?
> > > > > > Thanks for answering ... > > > > > > I have specified a search string for record selection at run time: > > > > > > With frmCrystal.CrystalReport1 > > > > > > .SelectionFormula = strSQLString > > > > > > .Destination = crptToPrinter > > > > > > .ReportSource = crptReport > > > > > > .ReportFileName = strFileName > > > > > > .WindowState = crptMaximized > > > > > > .Action = 1 > > > > > > End With > > > > > > My problem is, (I think), interpreting the search results within > > > > crystal. > > > > > > I'm getting the following Error Message: > > > > > > Error Number 20515 > > > > > > Error Description: Error In Formula <Record_Selction> The > remaining > > > > text > > > > > > does not appear to be part of the formula. > > > > > > The query runs correctly against the database, so I must be doing > > > > > something > > > > > > wrong within Crystal. What is the correct way to pass this Search > > > > string > > > > > in > > > > > > to crystal for display? > > > > > > Any help would be greatly appreciated.
> > > > > > > You simply specify record selection formula at run time.
> > > > > > > > Hey, > > > > > > > > I've queried an Oracle databse thru a VB application and > > displayed > > > > the > > > > > > > > results into a MSHFlexGrid, and I need to be able to print > these > > > > > results > > > > > > > off > > > > > > > > into a Crystal Report. > > > > > > > > However, the parameters that bring back this info are going to > > be > > > > > > > different > > > > > > > > every time, so I'll have to specify them on the fly. > > > > > > > > Any suggestions would be appreciated. > > > > > > > > Thanks.
|
Sun, 10 Apr 2005 22:21:04 GMT |
|
 |
CW #10 / 17
|
 Print contents of VB grid into Crystal Report?
If you want to pass the entire SQL string, you need to set SQLString property, not SelectionFormula property. In addition, the select list must match that current used in the report.
Quote: > Are you saying that I can't pass SQL query into Crystal for it to display > the results?
> > strSQL is the value you are passing to selection formula. However, you are > > passing a SQL query string! > > selection formula would have content such as "{mytable.myfield} = 1"
> > > This is one example, although not the most complex. In filling the grid > > the > > > user could be querying up to 4 separate tables. In the example below > only > > 2 > > > tables are queried: > > > SELECT > > > C.CERTIFICATE_NO, W.ORDER_NO, C.CERTIFICATE_TYPE, W.JOB_NO, > > > W.CONTRACT_NO, W.CONTRACT_REFERENCE, C.DETAILS_OF_PART_COMPLETION, > > > C.ISSUED_BY, C.DATE_ISSUED, C.ISSUE_COMMENTS, C.SENT_TO_FOR_ISSUE, > > > C.COMPLETION_DATE, C.VALUE_OF_PART_COMPLETION, C.ENTERED_BY, > > > C.CONT_ISSUE_STATUS, C.REVISED_CONT_ISSUE_DATE, C.CLIENT_ISSUE_STATUS, > > > C.REVISED_CLIENT_ISSUE_DATE > > > FROM CERTIFICATE_OF_COMPLETION C, WORKORDER W > > > WHERE W.ORDER_NO = C.ORDER_NO AND C.ISSUED_BY LIKE 'TEST1%' > > > Is there something specific I should be doing on the Crystal Report, > e.g. > > > with the "Edit Selection Formula" option? I'm not sure how the Report > is > > > translating the sqlstring I'm passing across. > > > Thanks.
> > > > Give me an example of the value where it gives you error you mentioned > > in > > > > your last post. I am sure the error is due the value you have passed > in > > > the > > > > report. It's hard to troubleshoot without knowing some examples.
> > > > > The value of the SQLString is not constant - it depends on what > > > variables > > > > > the user wants to use to populate the Grid in VB - that they want to > > be > > > > able > > > > > to print off, so it will be different every time.
> > > > > > What's value of strSQLString?
> > > > > > > Thanks for answering ... > > > > > > > I have specified a search string for record selection at run > time: > > > > > > > With frmCrystal.CrystalReport1 > > > > > > > .SelectionFormula = strSQLString > > > > > > > .Destination = crptToPrinter > > > > > > > .ReportSource = crptReport > > > > > > > .ReportFileName = strFileName > > > > > > > .WindowState = crptMaximized > > > > > > > .Action = 1 > > > > > > > End With > > > > > > > My problem is, (I think), interpreting the search results within > > > > > crystal. > > > > > > > I'm getting the following Error Message: > > > > > > > Error Number 20515 > > > > > > > Error Description: Error In Formula <Record_Selction> The > > remaining > > > > > text > > > > > > > does not appear to be part of the formula. > > > > > > > The query runs correctly against the database, so I must be > doing > > > > > > something > > > > > > > wrong within Crystal. What is the correct way to pass this > Search > > > > > string > > > > > > in > > > > > > > to crystal for display? > > > > > > > Any help would be greatly appreciated.
> > > > > > > > You simply specify record selection formula at run time.
message
> > > > > > > > > Hey, > > > > > > > > > I've queried an Oracle databse thru a VB application and > > > displayed > > > > > the > > > > > > > > > results into a MSHFlexGrid, and I need to be able to print > > these > > > > > > results > > > > > > > > off > > > > > > > > > into a Crystal Report. > > > > > > > > > However, the parameters that bring back this info are going > to > > > be > > > > > > > > different > > > > > > > > > every time, so I'll have to specify them on the fly. > > > > > > > > > Any suggestions would be appreciated. > > > > > > > > > Thanks.
|
Sun, 10 Apr 2005 22:36:34 GMT |
|
 |
Aidan Field #11 / 17
|
 Print contents of VB grid into Crystal Report?
Cheers for that, but I think that's part of my problem. The SELECT list will change depending on what parameters the user has selected to fill the grid. Is there a way around this? Do I have to specify a select list in the report? Can I specify a simple one that will be over-written by the one I'm passing in through the SQLQuery property, i.e.: With frmCrystal.CrystalReport1 .SQLQuery = strSQLString End With Thanks.
Quote: > If you want to pass the entire SQL string, you need to set SQLString > property, not SelectionFormula property. In addition, the select list must > match that current used in the report.
> > Are you saying that I can't pass SQL query into Crystal for it to display > > the results?
> > > strSQL is the value you are passing to selection formula. However, you > are > > > passing a SQL query string! > > > selection formula would have content such as "{mytable.myfield} = 1"
> > > > This is one example, although not the most complex. In filling the > grid > > > the > > > > user could be querying up to 4 separate tables. In the example below > > only > > > 2 > > > > tables are queried: > > > > SELECT > > > > C.CERTIFICATE_NO, W.ORDER_NO, C.CERTIFICATE_TYPE, W.JOB_NO, > > > > W.CONTRACT_NO, W.CONTRACT_REFERENCE, C.DETAILS_OF_PART_COMPLETION, > > > > C.ISSUED_BY, C.DATE_ISSUED, C.ISSUE_COMMENTS, C.SENT_TO_FOR_ISSUE, > > > > C.COMPLETION_DATE, C.VALUE_OF_PART_COMPLETION, C.ENTERED_BY, > > > > C.CONT_ISSUE_STATUS, C.REVISED_CONT_ISSUE_DATE,
C.CLIENT_ISSUE_STATUS, Quote: > > > > C.REVISED_CLIENT_ISSUE_DATE > > > > FROM CERTIFICATE_OF_COMPLETION C, WORKORDER W > > > > WHERE W.ORDER_NO = C.ORDER_NO AND C.ISSUED_BY LIKE 'TEST1%' > > > > Is there something specific I should be doing on the Crystal Report, > > e.g. > > > > with the "Edit Selection Formula" option? I'm not sure how the Report > > is > > > > translating the sqlstring I'm passing across. > > > > Thanks.
> > > > > Give me an example of the value where it gives you error you > mentioned > > > in > > > > > your last post. I am sure the error is due the value you have passed > > in > > > > the > > > > > report. It's hard to troubleshoot without knowing some examples.
> > > > > > The value of the SQLString is not constant - it depends on what > > > > variables > > > > > > the user wants to use to populate the Grid in VB - that they want > to > > > be > > > > > able > > > > > > to print off, so it will be different every time.
> > > > > > > What's value of strSQLString?
> > > > > > > > Thanks for answering ... > > > > > > > > I have specified a search string for record selection at run > > time: > > > > > > > > With frmCrystal.CrystalReport1 > > > > > > > > .SelectionFormula = strSQLString > > > > > > > > .Destination = crptToPrinter > > > > > > > > .ReportSource = crptReport > > > > > > > > .ReportFileName = strFileName > > > > > > > > .WindowState = crptMaximized > > > > > > > > .Action = 1 > > > > > > > > End With > > > > > > > > My problem is, (I think), interpreting the search results > within > > > > > > crystal. > > > > > > > > I'm getting the following Error Message: > > > > > > > > Error Number 20515 > > > > > > > > Error Description: Error In Formula <Record_Selction> The > > > remaining > > > > > > text > > > > > > > > does not appear to be part of the formula. > > > > > > > > The query runs correctly against the database, so I must be > > doing > > > > > > > something > > > > > > > > wrong within Crystal. What is the correct way to pass this > > Search > > > > > > string > > > > > > > in > > > > > > > > to crystal for display? > > > > > > > > Any help would be greatly appreciated.
> > > > > > > > > You simply specify record selection formula at run time.
> message
> > > > > > > > > > Hey, > > > > > > > > > > I've queried an Oracle databse thru a VB application and > > > > displayed > > > > > > the > > > > > > > > > > results into a MSHFlexGrid, and I need to be able to print > > > these > > > > > > > results > > > > > > > > > off > > > > > > > > > > into a Crystal Report. > > > > > > > > > > However, the parameters that bring back this info are > going > > to > > > > be > > > > > > > > > different > > > > > > > > > > every time, so I'll have to specify them on the fly. > > > > > > > > > > Any suggestions would be appreciated. > > > > > > > > > > Thanks.
|
Tue, 12 Apr 2005 22:30:21 GMT |
|
 |
CW #12 / 17
|
 Print contents of VB grid into Crystal Report?
If you go to database -> show SQL Query, you would find the current SQL query used by CR, hence its select list. If you want to change select list, you must use RDC, not OCX Control.
Quote: > Cheers for that, but I think that's part of my problem. The SELECT list > will change depending on what parameters the user has selected to fill the > grid. Is there a way around this? Do I have to specify a select list in > the report? Can I specify a simple one that will be over-written by the one > I'm passing in through the SQLQuery property, i.e.: > With frmCrystal.CrystalReport1 > .SQLQuery = strSQLString > End With > Thanks.
> > If you want to pass the entire SQL string, you need to set SQLString > > property, not SelectionFormula property. In addition, the select list must > > match that current used in the report.
> > > Are you saying that I can't pass SQL query into Crystal for it to > display > > > the results?
> > > > strSQL is the value you are passing to selection formula. However, you > > are > > > > passing a SQL query string! > > > > selection formula would have content such as "{mytable.myfield} = 1"
> > > > > This is one example, although not the most complex. In filling the > > grid > > > > the > > > > > user could be querying up to 4 separate tables. In the example > below > > > only > > > > 2 > > > > > tables are queried: > > > > > SELECT > > > > > C.CERTIFICATE_NO, W.ORDER_NO, C.CERTIFICATE_TYPE, W.JOB_NO, > > > > > W.CONTRACT_NO, W.CONTRACT_REFERENCE, C.DETAILS_OF_PART_COMPLETION, > > > > > C.ISSUED_BY, C.DATE_ISSUED, C.ISSUE_COMMENTS, C.SENT_TO_FOR_ISSUE, > > > > > C.COMPLETION_DATE, C.VALUE_OF_PART_COMPLETION, C.ENTERED_BY, > > > > > C.CONT_ISSUE_STATUS, C.REVISED_CONT_ISSUE_DATE, > C.CLIENT_ISSUE_STATUS, > > > > > C.REVISED_CLIENT_ISSUE_DATE > > > > > FROM CERTIFICATE_OF_COMPLETION C, WORKORDER W > > > > > WHERE W.ORDER_NO = C.ORDER_NO AND C.ISSUED_BY LIKE 'TEST1%' > > > > > Is there something specific I should be doing on the Crystal Report, > > > e.g. > > > > > with the "Edit Selection Formula" option? I'm not sure how the > Report > > > is > > > > > translating the sqlstring I'm passing across. > > > > > Thanks.
> > > > > > Give me an example of the value where it gives you error you > > mentioned > > > > in > > > > > > your last post. I am sure the error is due the value you have > passed > > > in > > > > > the > > > > > > report. It's hard to troubleshoot without knowing some examples.
> > > > > > > The value of the SQLString is not constant - it depends on what > > > > > variables > > > > > > > the user wants to use to populate the Grid in VB - that they > want > > to > > > > be > > > > > > able > > > > > > > to print off, so it will be different every time.
> > > > > > > > What's value of strSQLString?
message
> > > > > > > > > Thanks for answering ... > > > > > > > > > I have specified a search string for record selection at run > > > time: > > > > > > > > > With frmCrystal.CrystalReport1 > > > > > > > > > .SelectionFormula = strSQLString > > > > > > > > > .Destination = crptToPrinter > > > > > > > > > .ReportSource = crptReport > > > > > > > > > .ReportFileName = strFileName > > > > > > > > > .WindowState = crptMaximized > > > > > > > > > .Action = 1 > > > > > > > > > End With > > > > > > > > > My problem is, (I think), interpreting the search results > > within > > > > > > > crystal. > > > > > > > > > I'm getting the following Error Message: > > > > > > > > > Error Number 20515 > > > > > > > > > Error Description: Error In Formula <Record_Selction> The > > > > remaining > > > > > > > text > > > > > > > > > does not appear to be part of the formula. > > > > > > > > > The query runs correctly against the database, so I must be > > > doing > > > > > > > > something > > > > > > > > > wrong within Crystal. What is the correct way to pass this > > > Search > > > > > > > string > > > > > > > > in > > > > > > > > > to crystal for display? > > > > > > > > > Any help would be greatly appreciated.
> > > > > > > > > > You simply specify record selection formula at run time.
> > message
> > > > > > > > > > > Hey, > > > > > > > > > > > I've queried an Oracle databse thru a VB application and > > > > > displayed > > > > > > > the > > > > > > > > > > > results into a MSHFlexGrid, and I need to be able to > print > > > > these > > > > > > > > results > > > > > > > > > > off > > > > > > > > > > > into a Crystal Report. > > > > > > > > > > > However, the parameters that bring back this info are > > going > > > to > > > > > be > > > > > > > > > > different > > > > > > > > > > > every time, so I'll have to specify them on the fly. > > > > > > > > > > > Any suggestions would be appreciated. > > > > > > > > > > > Thanks.
|
Wed, 13 Apr 2005 08:12:29 GMT |
|
 |
Aidan Field #13 / 17
|
 Print contents of VB grid into Crystal Report?
I'm sorry if we're talking at cross purposes here, I'll try to be more clear on what I need to know. The SQL string I want to pass in will change every time a user runs the program. I can't go to Database - Show SQL Query and paste it in, because I don't know what it's going to be. I need to be able to pass the user-defined SQL Query through programmatically at run-time. I will know the select list I want to bring back, but I won't know the specific search criteria, i.e. the paramters the users will pick at run-time. So I suppose it's these search parameters that I have to pass in at run-time and append onto the end of the SQL query. If I build a SQL string including these user selected parameters at run-time can I pass it in through the .SQLString property of the Crystal Report, and will it then dispaly the results? Thanks.
Quote: > If you go to database -> show SQL Query, you would find the current SQL > query used by CR, hence its select list. > If you want to change select list, you must use RDC, not OCX Control.
> > Cheers for that, but I think that's part of my problem. The SELECT list > > will change depending on what parameters the user has selected to fill the > > grid. Is there a way around this? Do I have to specify a select list in > > the report? Can I specify a simple one that will be over-written by the > one > > I'm passing in through the SQLQuery property, i.e.: > > With frmCrystal.CrystalReport1 > > .SQLQuery = strSQLString > > End With > > Thanks.
> > > If you want to pass the entire SQL string, you need to set SQLString > > > property, not SelectionFormula property. In addition, the select list > must > > > match that current used in the report.
> > > > Are you saying that I can't pass SQL query into Crystal for it to > > display > > > > the results?
> > > > > strSQL is the value you are passing to selection formula. However, > you > > > are > > > > > passing a SQL query string! > > > > > selection formula would have content such as "{mytable.myfield} = 1"
> > > > > > This is one example, although not the most complex. In filling > the > > > grid > > > > > the > > > > > > user could be querying up to 4 separate tables. In the example > > below > > > > only > > > > > 2 > > > > > > tables are queried: > > > > > > SELECT > > > > > > C.CERTIFICATE_NO, W.ORDER_NO, C.CERTIFICATE_TYPE, W.JOB_NO, > > > > > > W.CONTRACT_NO, W.CONTRACT_REFERENCE,
C.DETAILS_OF_PART_COMPLETION, Quote: > > > > > > C.ISSUED_BY, C.DATE_ISSUED, C.ISSUE_COMMENTS,
C.SENT_TO_FOR_ISSUE, Quote: > > > > > > C.COMPLETION_DATE, C.VALUE_OF_PART_COMPLETION, C.ENTERED_BY, > > > > > > C.CONT_ISSUE_STATUS, C.REVISED_CONT_ISSUE_DATE, > > C.CLIENT_ISSUE_STATUS, > > > > > > C.REVISED_CLIENT_ISSUE_DATE > > > > > > FROM CERTIFICATE_OF_COMPLETION C, WORKORDER W > > > > > > WHERE W.ORDER_NO = C.ORDER_NO AND C.ISSUED_BY LIKE 'TEST1%' > > > > > > Is there something specific I should be doing on the Crystal > Report, > > > > e.g. > > > > > > with the "Edit Selection Formula" option? I'm not sure how the > > Report > > > > is > > > > > > translating the sqlstring I'm passing across. > > > > > > Thanks.
> > > > > > > Give me an example of the value where it gives you error you > > > mentioned > > > > > in > > > > > > > your last post. I am sure the error is due the value you have > > passed > > > > in > > > > > > the > > > > > > > report. It's hard to troubleshoot without knowing some examples.
> > > > > > > > The value of the SQLString is not constant - it depends on > what > > > > > > variables > > > > > > > > the user wants to use to populate the Grid in VB - that they > > want > > > to > > > > > be > > > > > > > able > > > > > > > > to print off, so it will be different every time.
> > > > > > > > > What's value of strSQLString?
> message
> > > > > > > > > > Thanks for answering ... > > > > > > > > > > I have specified a search string for record selection at > run > > > > time: > > > > > > > > > > With frmCrystal.CrystalReport1 > > > > > > > > > > .SelectionFormula = strSQLString > > > > > > > > > > .Destination = crptToPrinter > > > > > > > > > > .ReportSource = crptReport > > > > > > > > > > .ReportFileName = strFileName > > > > > > > > > > .WindowState = crptMaximized > > > > > > > > > > .Action = 1 > > > > > > > > > > End With > > > > > > > > > > My problem is, (I think), interpreting the search results > > > within > > > > > > > > crystal. > > > > > > > > > > I'm getting the following Error Message: > > > > > > > > > > Error Number 20515 > > > > > > > > > > Error Description: Error In Formula <Record_Selction> The > > > > > remaining > > > > > > > > text > > > > > > > > > > does not appear to be part of the formula. > > > > > > > > > > The query runs correctly against the database, so I must > be > > > > doing > > > > > > > > > something > > > > > > > > > > wrong within Crystal. What is the correct way to pass > this > > > > Search > > > > > > > > string > > > > > > > > > in > > > > > > > > > > to crystal for display? > > > > > > > > > > Any help would be greatly appreciated.
> > > > > > > > > > > You simply specify record selection formula at run time.
> > > message
> > > > > > > > > > > > Hey, > > > > > > > > > > > > I've queried an Oracle databse thru a VB application > and > > > > > > displayed > > > > > > > > the > > > > > > > > > > > > results into a MSHFlexGrid, and I need to be able to > > print > > > > > these > > > > > > > > > results > > > > > > > > > > > off > > > > > > > > > > > > into a Crystal Report. > > > > > > > > > > > > However, the parameters that bring back this info are > > > going > > > > to > > > > > > be > > > > > > > > > > > different > > > > > > > > > > > > every time, so I'll have to specify them on the fly. > > > > > > > > > > > > Any suggestions would be appreciated. > > > > > > > > > > > > Thanks.
|
Sat, 16 Apr 2005 00:25:24 GMT |
|
 |
CW #14 / 17
|
 Print contents of VB grid into Crystal Report?
If all you need to change is the where clause, not the select list, the best way is to change record selection formula. You were using SelectionFormula, and that's the correct property to use. The only problem was that you were setting its value to the entire SQL String. It is expecting a formula text. The selection formula text would have something like "{MyTable.MyField}=1".
Quote: > I'm sorry if we're talking at cross purposes here, I'll try to be more clear > on what I need to know. > The SQL string I want to pass in will change every time a user runs the > program. I can't go to Database - Show SQL Query and paste it in, because I > don't know what it's going to be. I need to be able to pass the > user-defined SQL Query through programmatically at run-time. > I will know the select list I want to bring back, but I won't know the > specific search criteria, i.e. the paramters the users will pick at > run-time. So I suppose it's these search parameters that I have to pass in > at run-time and append onto the end of the SQL query. > If I build a SQL string including these user selected parameters at run-time > can I pass it in through the .SQLString property of the Crystal Report, and > will it then dispaly the results? > Thanks.
> > If you go to database -> show SQL Query, you would find the current SQL > > query used by CR, hence its select list. > > If you want to change select list, you must use RDC, not OCX Control.
> > > Cheers for that, but I think that's part of my problem. The SELECT list > > > will change depending on what parameters the user has selected to fill > the > > > grid. Is there a way around this? Do I have to specify a select list > in > > > the report? Can I specify a simple one that will be over-written by the > > one > > > I'm passing in through the SQLQuery property, i.e.: > > > With frmCrystal.CrystalReport1 > > > .SQLQuery = strSQLString > > > End With > > > Thanks.
> > > > If you want to pass the entire SQL string, you need to set SQLString > > > > property, not SelectionFormula property. In addition, the select list > > must > > > > match that current used in the report.
> > > > > Are you saying that I can't pass SQL query into Crystal for it to > > > display > > > > > the results?
> > > > > > strSQL is the value you are passing to selection formula. However, > > you > > > > are > > > > > > passing a SQL query string! > > > > > > selection formula would have content such as "{mytable.myfield} = > 1"
> > > > > > > This is one example, although not the most complex. In filling > > the > > > > grid > > > > > > the > > > > > > > user could be querying up to 4 separate tables. In the example > > > below > > > > > only > > > > > > 2 > > > > > > > tables are queried: > > > > > > > SELECT > > > > > > > C.CERTIFICATE_NO, W.ORDER_NO, C.CERTIFICATE_TYPE, W.JOB_NO, > > > > > > > W.CONTRACT_NO, W.CONTRACT_REFERENCE, > C.DETAILS_OF_PART_COMPLETION, > > > > > > > C.ISSUED_BY, C.DATE_ISSUED, C.ISSUE_COMMENTS, > C.SENT_TO_FOR_ISSUE, > > > > > > > C.COMPLETION_DATE, C.VALUE_OF_PART_COMPLETION, C.ENTERED_BY, > > > > > > > C.CONT_ISSUE_STATUS, C.REVISED_CONT_ISSUE_DATE, > > > C.CLIENT_ISSUE_STATUS, > > > > > > > C.REVISED_CLIENT_ISSUE_DATE > > > > > > > FROM CERTIFICATE_OF_COMPLETION C, WORKORDER W > > > > > > > WHERE W.ORDER_NO = C.ORDER_NO AND C.ISSUED_BY LIKE 'TEST1%' > > > > > > > Is there something specific I should be doing on the Crystal > > Report, > > > > > e.g. > > > > > > > with the "Edit Selection Formula" option? I'm not sure how the > > > Report > > > > > is > > > > > > > translating the sqlstring I'm passing across. > > > > > > > Thanks.
> > > > > > > > Give me an example of the value where it gives you error you > > > > mentioned > > > > > > in > > > > > > > > your last post. I am sure the error is due the value you have > > > passed > > > > > in > > > > > > > the > > > > > > > > report. It's hard to troubleshoot without knowing some > examples.
message
> > > > > > > > > The value of the SQLString is not constant - it depends on > > what > > > > > > > variables > > > > > > > > > the user wants to use to populate the Grid in VB - that they > > > want > > > > to > > > > > > be > > > > > > > > able > > > > > > > > > to print off, so it will be different every time.
> > > > > > > > > > What's value of strSQLString?
> > message
> > > > > > > > > > > Thanks for answering ... > > > > > > > > > > > I have specified a search string for record selection at > > run > > > > > time: > > > > > > > > > > > With frmCrystal.CrystalReport1 > > > > > > > > > > > .SelectionFormula = strSQLString > > > > > > > > > > > .Destination = crptToPrinter > > > > > > > > > > > .ReportSource = crptReport > > > > > > > > > > > .ReportFileName = strFileName > > > > > > > > > > > .WindowState = crptMaximized > > > > > > > > > > > .Action = 1 > > > > > > > > > > > End With > > > > > > > > > > > My problem is, (I think), interpreting the search > results > > > > within > > > > > > > > > crystal. > > > > > > > > > > > I'm getting the following Error Message: > > > > > > > > > > > Error Number 20515 > > > > > > > > > > > Error Description: Error In Formula <Record_Selction> > The > > > > > > remaining > > > > > > > > > text > > > > > > > > > > > does not appear to be part of the formula. > > > > > > > > > > > The query runs correctly against the database, so I must > > be > > > > > doing > > > > > > > > > > something > > > > > > > > > > > wrong within Crystal. What is the correct way to pass > > this > > > > > Search > > > > > > > > > string > > > > > > > > > > in > > > > > > > > > > > to crystal for display? > > > > > > > > > > > Any help would be greatly appreciated.
> > > > > > > > > > > > You simply specify record selection formula at run > time.
in > > > > message
> > > > > > > > > > > > > Hey, > > > > > > > > > > > > > I've queried an Oracle databse thru a VB application > > and > > > > > > > displayed > > > > > > > > > the > > > > > > > > > > > > > results into a MSHFlexGrid, and I need to be able to > > > print > > > > > > these > > > > > > > > > > results > > > > > > > > > > > > off > > > > > > > > > > > > > into a Crystal Report. > > > > > > > > > > > > > However, the parameters that bring back this info > are > > > > going > > > > > to > > > > > > > be > > > > > > > > > > > > different > > > > > > > > > > > > > every time, so I'll have to specify them on the fly. > > > > > > > > > > > > > Any suggestions would be appreciated. > > > > > > > > > > > > > Thanks.
|
Sat, 16 Apr 2005 16:13:30 GMT |
|
 |
And #15 / 17
|
 Print contents of VB grid into Crystal Report?
Quote:
> Hey, > I've queried an Oracle databse thru a VB application and displayed the > results into a MSHFlexGrid, and I need to be able to print these results off > into a Crystal Report. > However, the parameters that bring back this info are going to be different > every time, so I'll have to specify them on the fly. > Any suggestions would be appreciated. > Thanks.
Essentially... You have a variable number of columns and criteria and you sling it into a flexgrid ( thus Vb6? ) and you want to print the thing out? If you do a print screen you get a big black qquare where the flexgrid is because there's a weird bug. Alternatives spring to mind... in no particular order: 1) Create a picture box same size as the grid. To print screen: Copy the picture property of the grid to this, make the grid invisible and the picture visible, printform. Obviously, switch back... 2) I'm guessing you have crystal out the VB box. So you can't just give it an ADO recordset like you can with later versions... But upgrading either crystal or to vs.net would allow you to hand a recordset over to a report had a bunch of dummy fields and link everything up at run time. An upgrade and a bunch of code... FWIW. in some ways the vs.net version of crystal is harder to work with than previous ones. 3) Slap the data into two tables with a date time key on it and design a crystal report takes this key as a parameter and slings it out. One as t he headings and another as the columns. 4) Forget crystal and print direct to thir default printer. So long as you just want something fairly plain this is not a huge amount of work BTW.
|
Mon, 18 Apr 2005 17:05:15 GMT |
|
|
Page 1 of 2
|
[ 17 post ] |
|
Go to page:
[1]
[2] |
|