Friday, March 30, 2012
Parameter Problem - driving me insane
MySQL 5
MyODBC 3.51
Crystal Reports.Net
and
ASP.Net using VB.Net
Set up the connection to the DB in Crystal using MyODBC. I used the Database expert to call my Stored Procedure which has one Parameter and the code is real simple going like this:
call SuccessLetter (AppNo)
From the wizard i can see and place all the fields from the SP onto the report as long as i hard code an application number into my parameter. But as soon as i change it to a variable (as above) i get the following error from Crystal: Unknown Fields AppNo in order clause MySQL ODBC 3.51 error 42S21
On the VB code side i used
Success.SetParameterValue("AppNo", GeneralFunctions.ApplicationNo)
to set up the parameter and this does get passed thru so the error is comming from the database expert - almost as if it dont recognise that my stored procedure has a parameter. Which it does and it does work if i use the SP outside of Crystal.
Any ideas - please help me before i go bald from tearing the hair out.
ThanksAnd another weird thing i;ve noticed is that Crystal puts the stored procedure in the list of tables when i use the database expert when i go to choose my tables
Parameter problem
my problem is i am not getting Param1.ParameterFieldName in intellisence.
I am using c# and visual studio 2003 crystal reports 9.0
I am using a stored procedure to built report and i have to pass start date and end date so pls help for this.
I would be obligedIn your coding you need to supply those values like this
sp_name 'param1','param2'
Wednesday, March 28, 2012
Parameter Number is Invalid
I am trying to create a Report on a Stored Procedure.
My Stored Procedure is having 3 parameters (2 datetime parameters and 1 integer parameter).
When i select the stored procedure in the initial stage, it asks for the parameters. I tried entering 2050-01-01 00:00:00.000, etc etc ...
But I am getting an error "Parameter Number 1 is invalid" which is the same datetime field.
When I run the stored procedure in the query analyser. Its runs fine:
exec spTravelRpt_Person_chargeno '01-01-1990 00:00:00.000','01-01-2050 00:00:00.000',-1.
Can anyone plzzzz plzzz help me.. bcoz i am stuck.. i cannot move forward..
Ur help will be appreicated.Give only 2050-01-01 to datetime field and when calling the SP from your front end, pass the parameter in the format you want|||Hi Madhi,
I tried giving that too ... just
2050-01-01 ...
but it didnt help me...
Its giving the same error:
Parameter number 1 is invalid.
What do i do ????|||change the parameters datatype to varchar(20) instead of datetime and check.sql
Tuesday, March 20, 2012
PaperSource
I would like to choose the paper source (i.e.: Tray1, Tray2...) for a HP printer.
I use this command:
crystalReport.SelectPrinter "", "", "" TO SET DEFAULT PRINTER
crystalReport.PaperSource = 261 TO SET TRAY1
That printer has 2 trays: if I set for printing on Tray1 but there's no paper into it, tray2 is automatically selected.
I don't want this! I want that a message is prompted in vb code or on the display of hp printer, I want to know that tray1 has no paper and print must be stopped.
How could I do this? Do it depend from the printer type? Is it possible or is it normal that the first tray with paper is used?From what I understand, you can only control the papersource property when the report is not being formatted for printing. So after you open the report, you must set this property before you connect to server and start pumping data into it via the PrintOut method.
Also, the value you should be passing for the upper bin is 1 (crPRBinUpper =1, crPRBinLower = 2), not 261 as your notes show.
dave|||First of all, sorry for my english and thanks for repling me!
With HP Printers upper bin are not good, they need a 'personal code' (261, 262 and so...).
Searching on the internet I've found info about that: after setting the default printer I must pass the tray I need to print.
It works right only if paper is in both of trayes but if a tray is empty it prints automatically using the other one.
Instead of this I would like to know (directly on the printer display or trhrought VB code) if a tray is empty so I can choose to use the other or cancel all.
I hope you understand, but I think there's no solution because I haven't found nothing on the web about this and nobody can help me :(|||Well, if you have a licenced copy of Crystal reports, you had better contact them and ask for a fix.
Dave|||I had a similar problem, passing printer parameters from winspool to an external .net printer appi.
to deal with this in .net, ref. the Crystal 10 CrystalDecisions.CrystalReports.Engine (ver. 10.0.3300.0? assembly)
dont use papersource, this is an enumerated standard.
use CustomPaperSource to set the source from the passed string after the PrinterName is set
code snip:
'Source
Dim m_PrinterSettings As New Printing.PrinterSettings
Dim m_PaperSource As System.Drawing.Printing.PaperSource
Dim m_PrinterSource As Printing.PaperSource
Try
For Each m_PrinterSource In m_PrinterSettings.PaperSources
If m_PrinterSource.SourceName.ToString = <my paper source> Then
m_PaperSource = m_PrinterSource
Exit For
End If
Next
crReportDocument.PrintOptions.CustomPaperSource = m_PaperSource
Catch
'just default to auto if problem
crReportDocument.PrintOptions.PaperSource = CrystalDecisions.[Shared].PaperSource.Auto
End Try
CustomPaperSource is not coded in the 9.x assembly(s)
there is a crystal descision KB article somewhere out there on this.
hope this helps.
Paper Based Reports Support
I am a newbie to SQL Reporting Services. I am trying to evaluate whether to
use SQL reporting services as opposed to crystal reports. I want to create
paper based reports as well as web based reports. Is it fair to say that
SQL Reporting Services focuses more on web based reports than on paper based
reports? I know that it can export reports in an Excel and PDF format but
that seems to be the full extent of true paper based reporting. Am I
missing something? Will there be more support for paper based reports in
the future?
Thanks,
VaughnDepends on what you mean by paper based reports. RS is a format independent
reporting solution. The report is specified via the RDL (if you look at the
RDL it is an xml file). The report definition says how the data should be
formated. How it is formated (rendered) depends on what you ask RS to do.
The default is HTML but that is just the default and really it is just one
of the rendering formats. When you see the export all that is happening is
RS is being asked to run the report but using a different rendering format.
PDF is the format that is used for printing today. With SP2 there will be a
print button on the toolbar which will provide client side printing so you
do not have to go through exporting. My guess (only a guess, no inside
knowledge) is that we will see SP2 sometime first quarter next year.
One thing that I do consider paper based that they do not yet handle well is
the whole issue of labels. For instance being able to easily design a report
for particular labels. In MS Access they have a wizard for this. The wizard
really doesn't do anything that couldn't be done in the GUI designer but it
makes it very easy to do so. It would be nice to have something like this in
RS.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Vaughn" <vhaybittle@.mweb.co.za> wrote in message
news:%23Ce6mq51EHA.1152@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I am a newbie to SQL Reporting Services. I am trying to evaluate whether
to
> use SQL reporting services as opposed to crystal reports. I want to
create
> paper based reports as well as web based reports. Is it fair to say that
> SQL Reporting Services focuses more on web based reports than on paper
based
> reports? I know that it can export reports in an Excel and PDF format but
> that seems to be the full extent of true paper based reporting. Am I
> missing something? Will there be more support for paper based reports in
> the future?
> Thanks,
> Vaughn
>
Pairing Group
records. I'm using Crystal Reports v.10 if that helps. I have a nchar Col4
and a date/time in Col3. I need to compare the date/time of every 2nd of 2
records. The time in the second record of each pair is always a few seconds
,
or a few minutes, greater than in the first record. Col1 and Col2 have
values that are always the same; Col4 varies slightly by the text message.
Any help would be appreciated. Thanks.This would be a self join. For example:
SELECT T1.col1, T1.col2, T1.col3, T1.col4,
MIN(T2.col3)
FROM YourTable AS T1
JOIN YourTable AS T2
ON T1.col3 < T2.col3
GROUP BY T1.col1, T1.col2, T1.col3, T1.col4
David Portas
SQL Server MVP
--|||David,
This query is helpful but I suppose I should have added that I need to CALC
a subtraction of the 1st row's date/timestamp from the 2nd row's
date/timestamp to produce an interval value such as :03 (seconds) etc. Is
this possible? Thanks.
"David Portas" wrote:
> This would be a self join. For example:
> SELECT T1.col1, T1.col2, T1.col3, T1.col4,
> MIN(T2.col3)
> FROM YourTable AS T1
> JOIN YourTable AS T2
> ON T1.col3 < T2.col3
> GROUP BY T1.col1, T1.col2, T1.col3, T1.col4
> --
> David Portas
> SQL Server MVP
> --
>
>|||SELECT T1.col1, T1.col2, T1.col3, T1.col4,
MIN(T2.col3), DATEDIFF(S,T1.col3,MIN(T2.col3))
FROM YourTable AS T1
JOIN YourTable AS T2
ON T1.col3 < T2.col3
GROUP BY T1.col1, T1.col2, T1.col3, T1.col4
David Portas
SQL Server MVP
--|||This was what I needed and it worked great. I marked it a Helpful Post.
Thanks!
"David Portas" wrote:
> SELECT T1.col1, T1.col2, T1.col3, T1.col4,
> MIN(T2.col3), DATEDIFF(S,T1.col3,MIN(T2.col3))
> FROM YourTable AS T1
> JOIN YourTable AS T2
> ON T1.col3 < T2.col3
> GROUP BY T1.col1, T1.col2, T1.col3, T1.col4
> --
> David Portas
> SQL Server MVP
> --
>
>
Saturday, February 25, 2012
page totals in crystal report
i am a new user to crystel report. i am using the crystal
report with vb. i have a report with some groups and
sub-groups. i want to print pagewise totals on each page.
pl show me the way.
thanks
shrikant
shrikant_smart@.rediffmail.comIn Crystal Reports 8.5, click Insert, Field Object. This will bring up a list of field objects. Expand 'Special Fields' and you can see your options of 'Page Number', 'Total Page Count', 'Page N of M', etc. Just drag and drop onto your report and position where you want it.|||I don't know this is the proper way or not. any way this will display page viz totals.
Create Formula named tot1
code:
WhilePrintingRecords;
NumberVar total;
total := 0
formula 2 : tot2
WhilePrintingRecords;
NumberVar total;
total := total + {amount};
formula 3 : tot3
WhilePrintingRecords;
NumberVar total;
Use the same variable name.
place tot1 is page header section. This will reset the total value to 0 for each and every page.
Place tot2 in details section. This will add the values.
Format both as suppressed.
Place the tot3 in Page Footer section. This will display page viz total.
Page Totals in Crystal Report
Page Termination Crystal 8.5
Page Size
In crystal reports, I can define page size (letter size or legal size) and
page orientation (Langscap or Prortrait) so the preview exactly looks like
the final print.
Is it possible to do that in MSRS?
To re-word the question, How can I define the page size (letter size or
legal size) and page orientation (Langscap or Prortrait) at design time in
Microsoft Reporting services ?
Thank you,
AlanIn VSNET, open a report in designer, click menu "Report->Report
Properties...", then "Layout" tab.
"A.M" <nospam1@.online.nospam> wrote in message
news:e5y7M7KoEHA.1308@.TK2MSFTNGP14.phx.gbl...
> Hi,
> In crystal reports, I can define page size (letter size or legal size) and
> page orientation (Langscap or Prortrait) so the preview exactly looks like
> the final print.
> Is it possible to do that in MSRS?
> To re-word the question, How can I define the page size (letter size or
> legal size) and page orientation (Langscap or Prortrait) at design time in
> Microsoft Reporting services ?
> Thank you,
> Alan
>
>
Monday, February 20, 2012
page setup on crystal report 8.5
i want to ask you a question on crystal report 8.5.
i'm using crystal report viewer from visual basic 6.0 to view reports but i'm found problems to setup page margin until this time. can you help me for a while ??
how to view page setup on my crystal report viewer so end user have flexibility to customize the margin ??
thanks for your help.
emmileI think you cannot do that at run time
You need to design it in Design time
Page Setup
I want to build a report in Crystal Reports XI but the problem is that i have to report on around 20-30 fields.
Is there a way to increase the width of the reporting page as I'm not able to increase it by more than A3 size.
Please help.
regards
PrashU can increase the size of the sheet provided that ur printer supports that particular sheet. Else u can try using the custom settings to set the size of the page. But then it might not print if your printer does not support that particular size.|||Thnx for the advice, but how can i do the custom setting.|||In ver 8.5, select
File --> Printer Setup
click on properties button and select paper tab. In the dialog box, u can see a "custom" button next to the "size" drop down list. You can click on the custom button and set the custom size of the page.
But note that, the custom button will be disabled if the printer does not support it.
Page Orientation in Multipage report
Tweaking a report that was imported from Crystal Reports. Report has three pages, the first two are landscape, the last page is portrait.
Can this be done in RS or will I have to split up the report to render the 1st two pages separately from the last page (in two reports)?
Thanks in advance.
My two cents worth: It would really really be nice if RS had 1.) a rich text box and 2.) the ability to rotate labels and text boxes.
The page sizes in SSRS are at the report level, so you could not do that within 1 report.
It would be very nice to be able to change that at a page level.
BobP
|||Thanks for the reply. I guess I should have added my three cents worth!
Joe
Page Orientation
On at least 1 or 2 computers, a report that was designed to be in Landscape is previewing in Portrait. On all the other computers, the report previews normally (in Landscape). Could this be a result of a corrupted or out of date Crystal dll? If so, which one? Could it be because of the printer driver installed?
Does any one have any other ideas on what could cause the report to preview incorrectly? (The computer in question is running WinXP).
Thanks!I think it depends on the printer setup of the Client machine
Page Numbers
reset after a grouping in the body, is this possible?
In Crystal it is the checkbox option in the Section Expert tab called "Reset
Page Number After."I find the easiest way to do this is to use a subreport. I haven't found a
way to do that either other than subreporting it. The page numbers are only
shown on the subreport.
=-Chris
"Joe Astone" <JoeAstone@.discussions.microsoft.com> wrote in message
news:D4A3657B-2DAF-42BE-8A78-37278E851348@.microsoft.com...
>I need the page numbers in the header (or body if it can work like this) to
> reset after a grouping in the body, is this possible?
> In Crystal it is the checkbox option in the Section Expert tab called
> "Reset
> Page Number After."|||Do you have any groupings in your report?
Group A
Page 1
Page 2
Group B
Page 1
What I'm asking is that does the page number reset after each group?
"Christopher Conner" wrote:
> I find the easiest way to do this is to use a subreport. I haven't found a
> way to do that either other than subreporting it. The page numbers are only
> shown on the subreport.
> =-Chris
> "Joe Astone" <JoeAstone@.discussions.microsoft.com> wrote in message
> news:D4A3657B-2DAF-42BE-8A78-37278E851348@.microsoft.com...
> >I need the page numbers in the header (or body if it can work like this) to
> > reset after a grouping in the body, is this possible?
> >
> > In Crystal it is the checkbox option in the Section Expert tab called
> > "Reset
> > Page Number After."
>
>|||yes, my groupings are in a list (on recipient) so it can be mailed out to the
recipients, and i dont want them to see how many total pages are being mailed
out, just how many are being mailed to them
Joe Astone (passport name is company's in case you were wondering)
"Cu Nguyen" wrote:
> Do you have any groupings in your report?
> Group A
> Page 1
> Page 2
> Group B
> Page 1
> What I'm asking is that does the page number reset after each group?
> "Christopher Conner" wrote:
> > I find the easiest way to do this is to use a subreport. I haven't found a
> > way to do that either other than subreporting it. The page numbers are only
> > shown on the subreport.
> >
> > =-Chris
> >
> > "Joe Astone" <JoeAstone@.discussions.microsoft.com> wrote in message
> > news:D4A3657B-2DAF-42BE-8A78-37278E851348@.microsoft.com...
> > >I need the page numbers in the header (or body if it can work like this) to
> > > reset after a grouping in the body, is this possible?
> > >
> > > In Crystal it is the checkbox option in the Section Expert tab called
> > > "Reset
> > > Page Number After."
> >
> >
> >|||the subreport idea didnt work, it cut the header off of the subreport and
still did the total pages should i put it on the main report...any advice?
"Cu Nguyen" wrote:
> Do you have any groupings in your report?
> Group A
> Page 1
> Page 2
> Group B
> Page 1
> What I'm asking is that does the page number reset after each group?
> "Christopher Conner" wrote:
> > I find the easiest way to do this is to use a subreport. I haven't found a
> > way to do that either other than subreporting it. The page numbers are only
> > shown on the subreport.
> >
> > =-Chris
> >
> > "Joe Astone" <JoeAstone@.discussions.microsoft.com> wrote in message
> > news:D4A3657B-2DAF-42BE-8A78-37278E851348@.microsoft.com...
> > >I need the page numbers in the header (or body if it can work like this) to
> > > reset after a grouping in the body, is this possible?
> > >
> > > In Crystal it is the checkbox option in the Section Expert tab called
> > > "Reset
> > > Page Number After."
> >
> >
> >
Page number problem when creating reports from VB6
I have a very annoying problem. I use Crystal Reports 8 and I have several reports that are "created" from a VB 6 gui, well they're instansiated and loaded with params from VB. While doing this the reports seem to loose there page numbers. The reports use SP's in a MSSQL 2000 db. This problem does not seem to occur whenever I run the report in design mode but as soon as I try to create them from my VB applications all special fields that has anything to do with page numbers fail. Eg the Page N of M equals Page -1 of 1 which of couse is incorrect.
I've tried with a formula that I saw in a forum somewhere, it was something like:
shared numbervar PageNo;
PageNo := PageNo +1;
PageNo;
and put it in the Page Footer, however I have the same problem here, it works in design mode but not from VB6. Also, doesn't the declaration on the first line reset the variabel each time the formula runs or is it just a redeclaration?
Does anyone have any clues on what I can do? I'm stuck, seems like I've tried everything I can think of. Also, as far as I can see I don't reset the pagenumber after any section, so that shouldn't be an issue either..
Please help me with this one, I've tried searching every forum I've found but haven't come a cross a solution yet!
Regards,
neiden
edit::
I export the reports from VB6 to either a file in .rtf format or print it directlytry using "Global" Instead of "Shared"|||doesn't seem to work either.. now it only displays 1 on each page|||Have another issue as well. I have a database field which is a number with two decimals, whenever I export the report to file or printer from my VB 6 GUI I loose the decimals (replaced by ,00). This is the samething as with page numbers, when I run the report in design mode it shows correct data. I've formatted the field as both 1,00 and System defualt none works..
any ideas on why the reports get messed up whenever I run and export them from VB6?
Page Number display problem when using Cross Tab
Now, the columns in Cross Tab exceeds the page and therefore goes on next page. Everything works fine, the only thing is the next page does not display Page Header and Page Footer.
What may be the problem ? I have tried placing Cross Tab object Report Header,Report Footer,Page Header,Page Footer but din't got solution.
Thanks in advance.
Chandrakant Shindehttp://support.businessobjects.com/library/kbase/articles/c2008113.asp
this explains the process
dave
Page Number
hi,
report can be grouped by customer number and page number can be reset on new group. plz refer to the site below.
http://blogs.msdn.com/chrishays/archive/2006/01/05/ResetPageNumberOnGroup.aspx
|||I have tried this post but can not get it to work. I was also told by Microsoft that this wasn't supported. Ask if it might in future and person I was working with couldn't find anything in database.