hi...
i have a question here and need u'r help.
i have sales data in my vb form, and i want to preview or print it using crystal report. my problem is, crystal report print all sale data in my table sales. all sale data have their own resit number. how can i print only data with resit number that i key in, in my vb form?
hope u can help me...
TQTry the example attached to my post|||dear joe911..
thank u...but i can't open the attachment. can u tell me how i can open tha file that u given,..|||it is compressed with wiarar: http://www.rarlab.com
by the way this example apllies to ver 9.2
here is another one compressed using winzip|||thanz joe..|||i've try the code but i still have a problem. crystal report still preview all the data in sales table.
can anyone help me...|||u sure that u did like the example?
plz upload ur project|||Dear joe...
here is my coding...i use sql server as my database. Hope u can tell me what is wrong with my coding...
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Dim adoSql As ADODB.Connection
Private Sub Form_Load()
Dim strSQLStatement As String
Dim rsReport As ADODB.Recordset
strConnection = " Provider=sqloledb;data source=PRE;User ID=sa; initial catalog=PSM"
Set adoSql = New ADODB.Connection
Set rsReport = New ADODB.Recordset
adoSql.Open strConnection
strSQLStatement = "SELECT * FROM TSales" & _
" WHERE day ='" + Form5.DCday.Text + "'" & _
" AND month ='" + Form5.DCmonth.Text + "'" & _
" AND year ='" + Form5.txtyear.Text + "'" & _
" AND member_id= '" + Form5.txtmember.Text + "'"
Set rsReport = adoSql.Execute(strSQLStatement)
If rsReport.EOF Then
MsgBox " No Record Found", vbCritical, "Status"
Else
Set Report = Appl.OpenReport("D:\PSM ODBC\Laporan\Report2.rpt")
Screen.MousePointer = vbHourglass
CRViewer91.ReportSource = Report
CRViewer91.Zoom 70
CRViewer91.ViewReport
Screen.MousePointer = vbDefault
End If
adoSql.Close
End Sub|||ur code looks fine, but the problem isn't in the code, if u using external rpt files u have to UNCHECK this option: file>>save data with report , like this image:
http://yoyo911.spymac.net/images/Crystal_Problem.JPG
by the way using designer(my example) is better, coz no one can edit the design of the reports as there is no external .rpt files.
i hope this help u.
bye|||hi joe...
i'm sorry again but it't not work.
what do you mean external.rpt?|||what i meant by external.rpt is the report file,
i use the designer, it is something like the data report (means no rpt file needed, the report will be included in the .rpt file)
to use the deigner, just select project>>add crystal reports 9>>from existing report>>browse the report.
about ur problem : r u sure that u removed the true sign from the option Save data with report?
and try to use the way explained above.|||yup...i've uncheck Save data with report just like u said.
i'll try u'r to use the designer. hope it will works...
TQ again|||hi,
just figured u forgot this line:
CRViewer91.ReportSource = Report
Report.Database.SetDataSource rsReport, 3, 1|||i have try that line but have an error.
i though because i use sql server.
the example that u give to me use access as database.
what is 3, 1 mean?
Report.Database.SetDataSource rsReport, 3, 1|||sorry, i forgot that!
The syntax for SetDataSource is as follows:
[form] Object.SetDataSource data, DataTag, tableIndex
i think this method applies only for the designer as i didn't try it b4 with .rpt file,
try using this way and see what happens|||thank...i will try that code.
i really hope it works.
my due date is very near to present my system.|||hi...i still can't priview the report just like i want. it has an error. can u tell my how to solve this problem using data report in VB?|||Dear,
We r working with crystal reports 9 designer not Data Report!
would u plz send me ur project to this mail: joe911_2003@.yahoo.com|||hai joe...
i've settle my problem.
thank u for your attention and help.|||happy u passed ur problen.
would u plz tell me what was that?
thnx bye|||hi joe..
actually i'm not solve my problem the way that i want. tomorrow i must present my system so i don't have time to try solve my problem the way that i want. cause i don't know what is wrong...so i just use group method in crystal report.
the problem when i use this method is, the report will show all receipt num and i must search the receipt num that i want. when i klik that receipt number, it will display subreport that contain all the information about the receipt num. that the way that i see right now..don't know what the judge will say about that in my presentation tomorrow...
by the way thank cause your help and idea...hope i can try to solve that problem after my presentaion.
Saturday, February 25, 2012
Preview bug with default params
I have a bunch of reports with four parameters, two integers and two
datetimes. They don't have defaults. I have gone through them and added
another parameter, a string, nullable, with a default of =String.Empty (the
purpose of this is to have a parameter in which I can pass a unique ID, to
avoid caching). When I go to the preview tab in Report Designer, I enter
one of the default-less integer parameters. The parameter section flickers
once. Then I enter the next parameter value. The parameter section now
flickers endlessly, and Visual Studio stops responding. I have to have
Windows forcibly close it down.
If I go to http://localhost/Reports and navigate to the report, I enter the
first parameter value in the textbox, but when I try to move to the next
(hit Tab or click the mouse in the second parameter's input box), I get an
error page: "Reporting Services Error The value provided for the report
parameter <second parameter name here> is not valid for its type.
(rsReportParameterTypeMismatch)". I can hit the browser's Back button and
the value I've entered for the first parameter is still there, so I go to
enter the next parameter value, and then try to move to the third. New
error message about the third parameter, click Back, enter third parameter.
New error message about the fourth parameter, click Back, enter parameter.
What's interesting is up until this point, the text box for the new, default
parameter is disabled. But when I enter the fourth default-less parameter,
the browser clicks and the page refreshes, and now I can enter a value for
the last parameter if I want.DJM,
Sounds like the subsequent param appear dependent on the previous param.
This could lead to the error message being generated, and also the last param
box being disabled prior to the fourth param entry.
I have not suffered this particular problem as I have no linked params.
Hope this assists,
Tony
"DJM" wrote:
> I have a bunch of reports with four parameters, two integers and two
> datetimes. They don't have defaults. I have gone through them and added
> another parameter, a string, nullable, with a default of =String.Empty (the
> purpose of this is to have a parameter in which I can pass a unique ID, to
> avoid caching). When I go to the preview tab in Report Designer, I enter
> one of the default-less integer parameters. The parameter section flickers
> once. Then I enter the next parameter value. The parameter section now
> flickers endlessly, and Visual Studio stops responding. I have to have
> Windows forcibly close it down.
> If I go to http://localhost/Reports and navigate to the report, I enter the
> first parameter value in the textbox, but when I try to move to the next
> (hit Tab or click the mouse in the second parameter's input box), I get an
> error page: "Reporting Services Error The value provided for the report
> parameter <second parameter name here> is not valid for its type.
> (rsReportParameterTypeMismatch)". I can hit the browser's Back button and
> the value I've entered for the first parameter is still there, so I go to
> enter the next parameter value, and then try to move to the third. New
> error message about the third parameter, click Back, enter third parameter.
> New error message about the fourth parameter, click Back, enter parameter.
> What's interesting is up until this point, the text box for the new, default
> parameter is disabled. But when I enter the fourth default-less parameter,
> the browser clicks and the page refreshes, and now I can enter a value for
> the last parameter if I want.
>
>|||How so? It's a brand-new parameter; the existing ones don't reference it in
any way. In fact, *nothing* references this parameter.
"Logicalman" <tony9scott45us@.com7cast.net34> wrote in message
news:E96EC3A4-7308-4AD6-A2C3-F11ADD818D71@.microsoft.com...
> DJM,
> Sounds like the subsequent param appear dependent on the previous param.
> This could lead to the error message being generated, and also the last
> param
> box being disabled prior to the fourth param entry.
> I have not suffered this particular problem as I have no linked params.
> Hope this assists,
> Tony
>
> "DJM" wrote:
>> I have a bunch of reports with four parameters, two integers and two
>> datetimes. They don't have defaults. I have gone through them and added
>> another parameter, a string, nullable, with a default of =String.Empty
>> (the
>> purpose of this is to have a parameter in which I can pass a unique ID,
>> to
>> avoid caching). When I go to the preview tab in Report Designer, I enter
>> one of the default-less integer parameters. The parameter section
>> flickers
>> once. Then I enter the next parameter value. The parameter section now
>> flickers endlessly, and Visual Studio stops responding. I have to have
>> Windows forcibly close it down.
>> If I go to http://localhost/Reports and navigate to the report, I enter
>> the
>> first parameter value in the textbox, but when I try to move to the next
>> (hit Tab or click the mouse in the second parameter's input box), I get
>> an
>> error page: "Reporting Services Error The value provided for the report
>> parameter <second parameter name here> is not valid for its type.
>> (rsReportParameterTypeMismatch)". I can hit the browser's Back button
>> and
>> the value I've entered for the first parameter is still there, so I go to
>> enter the next parameter value, and then try to move to the third. New
>> error message about the third parameter, click Back, enter third
>> parameter.
>> New error message about the fourth parameter, click Back, enter
>> parameter.
>> What's interesting is up until this point, the text box for the new,
>> default
>> parameter is disabled. But when I enter the fourth default-less
>> parameter,
>> the browser clicks and the page refreshes, and now I can enter a value
>> for
>> the last parameter if I want.
>>
datetimes. They don't have defaults. I have gone through them and added
another parameter, a string, nullable, with a default of =String.Empty (the
purpose of this is to have a parameter in which I can pass a unique ID, to
avoid caching). When I go to the preview tab in Report Designer, I enter
one of the default-less integer parameters. The parameter section flickers
once. Then I enter the next parameter value. The parameter section now
flickers endlessly, and Visual Studio stops responding. I have to have
Windows forcibly close it down.
If I go to http://localhost/Reports and navigate to the report, I enter the
first parameter value in the textbox, but when I try to move to the next
(hit Tab or click the mouse in the second parameter's input box), I get an
error page: "Reporting Services Error The value provided for the report
parameter <second parameter name here> is not valid for its type.
(rsReportParameterTypeMismatch)". I can hit the browser's Back button and
the value I've entered for the first parameter is still there, so I go to
enter the next parameter value, and then try to move to the third. New
error message about the third parameter, click Back, enter third parameter.
New error message about the fourth parameter, click Back, enter parameter.
What's interesting is up until this point, the text box for the new, default
parameter is disabled. But when I enter the fourth default-less parameter,
the browser clicks and the page refreshes, and now I can enter a value for
the last parameter if I want.DJM,
Sounds like the subsequent param appear dependent on the previous param.
This could lead to the error message being generated, and also the last param
box being disabled prior to the fourth param entry.
I have not suffered this particular problem as I have no linked params.
Hope this assists,
Tony
"DJM" wrote:
> I have a bunch of reports with four parameters, two integers and two
> datetimes. They don't have defaults. I have gone through them and added
> another parameter, a string, nullable, with a default of =String.Empty (the
> purpose of this is to have a parameter in which I can pass a unique ID, to
> avoid caching). When I go to the preview tab in Report Designer, I enter
> one of the default-less integer parameters. The parameter section flickers
> once. Then I enter the next parameter value. The parameter section now
> flickers endlessly, and Visual Studio stops responding. I have to have
> Windows forcibly close it down.
> If I go to http://localhost/Reports and navigate to the report, I enter the
> first parameter value in the textbox, but when I try to move to the next
> (hit Tab or click the mouse in the second parameter's input box), I get an
> error page: "Reporting Services Error The value provided for the report
> parameter <second parameter name here> is not valid for its type.
> (rsReportParameterTypeMismatch)". I can hit the browser's Back button and
> the value I've entered for the first parameter is still there, so I go to
> enter the next parameter value, and then try to move to the third. New
> error message about the third parameter, click Back, enter third parameter.
> New error message about the fourth parameter, click Back, enter parameter.
> What's interesting is up until this point, the text box for the new, default
> parameter is disabled. But when I enter the fourth default-less parameter,
> the browser clicks and the page refreshes, and now I can enter a value for
> the last parameter if I want.
>
>|||How so? It's a brand-new parameter; the existing ones don't reference it in
any way. In fact, *nothing* references this parameter.
"Logicalman" <tony9scott45us@.com7cast.net34> wrote in message
news:E96EC3A4-7308-4AD6-A2C3-F11ADD818D71@.microsoft.com...
> DJM,
> Sounds like the subsequent param appear dependent on the previous param.
> This could lead to the error message being generated, and also the last
> param
> box being disabled prior to the fourth param entry.
> I have not suffered this particular problem as I have no linked params.
> Hope this assists,
> Tony
>
> "DJM" wrote:
>> I have a bunch of reports with four parameters, two integers and two
>> datetimes. They don't have defaults. I have gone through them and added
>> another parameter, a string, nullable, with a default of =String.Empty
>> (the
>> purpose of this is to have a parameter in which I can pass a unique ID,
>> to
>> avoid caching). When I go to the preview tab in Report Designer, I enter
>> one of the default-less integer parameters. The parameter section
>> flickers
>> once. Then I enter the next parameter value. The parameter section now
>> flickers endlessly, and Visual Studio stops responding. I have to have
>> Windows forcibly close it down.
>> If I go to http://localhost/Reports and navigate to the report, I enter
>> the
>> first parameter value in the textbox, but when I try to move to the next
>> (hit Tab or click the mouse in the second parameter's input box), I get
>> an
>> error page: "Reporting Services Error The value provided for the report
>> parameter <second parameter name here> is not valid for its type.
>> (rsReportParameterTypeMismatch)". I can hit the browser's Back button
>> and
>> the value I've entered for the first parameter is still there, so I go to
>> enter the next parameter value, and then try to move to the third. New
>> error message about the third parameter, click Back, enter third
>> parameter.
>> New error message about the fourth parameter, click Back, enter
>> parameter.
>> What's interesting is up until this point, the text box for the new,
>> default
>> parameter is disabled. But when I enter the fourth default-less
>> parameter,
>> the browser clicks and the page refreshes, and now I can enter a value
>> for
>> the last parameter if I want.
>>
Preview and Print Problem
I have problem with preview and printing using CP.
My report using A3 Landscape.
Some of my report do preview and printing correctly (see Item Received Report) but some of my report only view and print incorectly (see Audit Trail Receiving Report).
I have check my Page Setup on my CP editor and the configuration are correct (at least both report have same configuration).
Any solution for my problem, bro?use printer setup in the designer window of crystal report
and select ur desired page... and designed using this selected page
then compile the software...
it'll work
best of luck
zeeshangodil@.hotmail.com
My report using A3 Landscape.
Some of my report do preview and printing correctly (see Item Received Report) but some of my report only view and print incorectly (see Audit Trail Receiving Report).
I have check my Page Setup on my CP editor and the configuration are correct (at least both report have same configuration).
Any solution for my problem, bro?use printer setup in the designer window of crystal report
and select ur desired page... and designed using this selected page
then compile the software...
it'll work
best of luck
zeeshangodil@.hotmail.com
preview and print pdf reports
I have few reports which i need to distribute to a lot of clients and I
have following requirements on the clients:
- preview reports
- print reports
- count the number of printed pages (if the report is printed), this is
absolutely necessary functionality because clients are charged by the
number of printed pages
Currently I'm transferring dataset to the clients, and printing reports
using PrinterDocument...
I found that pretty clumsy, specially when adding new report: I had to
upgrade server, clients, create new printing functionality...
I was thinking about some other options and the most interesting so far
is to use SQL Server Reporting Services for creating reports on the
server. Clients will then download/open reports.
Adding new reports will be as simple as generating new report on the RS.
The missing part is a component for preview/print/count pages on the
client. I need options to view html or pdf reports on the client.
So I'm looking for the component which could preview/print/count pages
of the html or pdf document.
Any experience with such a component.
Any other ides for the the solution of the problem are welcome too.
Thanks,
Igor.It looks like you may have to do some serious programming to pull this off.
You could use the web service to render the PDF to a file on the server,
then count the pages by inspecting the PDF.
I'm not sure that you can programmatically count the number of HTML pages.
From what I've read, it's pretty arbitrary how they're broken out.
--
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"ianic" <ianic@.inet.hr> wrote in message
news:uSSOwvKzEHA.3512@.TK2MSFTNGP10.phx.gbl...
>I have few reports which i need to distribute to a lot of clients and I
>have following requirements on the clients:
> - preview reports
> - print reports
> - count the number of printed pages (if the report is printed), this is
> absolutely necessary functionality because clients are charged by the
> number of printed pages
> Currently I'm transferring dataset to the clients, and printing reports
> using PrinterDocument...
> I found that pretty clumsy, specially when adding new report: I had to
> upgrade server, clients, create new printing functionality...
> I was thinking about some other options and the most interesting so far is
> to use SQL Server Reporting Services for creating reports on the server.
> Clients will then download/open reports.
> Adding new reports will be as simple as generating new report on the RS.
> The missing part is a component for preview/print/count pages on the
> client. I need options to view html or pdf reports on the client.
>
> So I'm looking for the component which could preview/print/count pages of
> the html or pdf document.
> Any experience with such a component.
> Any other ides for the the solution of the problem are welcome too.
> Thanks,
> Igor.
>
>
have following requirements on the clients:
- preview reports
- print reports
- count the number of printed pages (if the report is printed), this is
absolutely necessary functionality because clients are charged by the
number of printed pages
Currently I'm transferring dataset to the clients, and printing reports
using PrinterDocument...
I found that pretty clumsy, specially when adding new report: I had to
upgrade server, clients, create new printing functionality...
I was thinking about some other options and the most interesting so far
is to use SQL Server Reporting Services for creating reports on the
server. Clients will then download/open reports.
Adding new reports will be as simple as generating new report on the RS.
The missing part is a component for preview/print/count pages on the
client. I need options to view html or pdf reports on the client.
So I'm looking for the component which could preview/print/count pages
of the html or pdf document.
Any experience with such a component.
Any other ides for the the solution of the problem are welcome too.
Thanks,
Igor.It looks like you may have to do some serious programming to pull this off.
You could use the web service to render the PDF to a file on the server,
then count the pages by inspecting the PDF.
I'm not sure that you can programmatically count the number of HTML pages.
From what I've read, it's pretty arbitrary how they're broken out.
--
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"ianic" <ianic@.inet.hr> wrote in message
news:uSSOwvKzEHA.3512@.TK2MSFTNGP10.phx.gbl...
>I have few reports which i need to distribute to a lot of clients and I
>have following requirements on the clients:
> - preview reports
> - print reports
> - count the number of printed pages (if the report is printed), this is
> absolutely necessary functionality because clients are charged by the
> number of printed pages
> Currently I'm transferring dataset to the clients, and printing reports
> using PrinterDocument...
> I found that pretty clumsy, specially when adding new report: I had to
> upgrade server, clients, create new printing functionality...
> I was thinking about some other options and the most interesting so far is
> to use SQL Server Reporting Services for creating reports on the server.
> Clients will then download/open reports.
> Adding new reports will be as simple as generating new report on the RS.
> The missing part is a component for preview/print/count pages on the
> client. I need options to view html or pdf reports on the client.
>
> So I'm looking for the component which could preview/print/count pages of
> the html or pdf document.
> Any experience with such a component.
> Any other ides for the the solution of the problem are welcome too.
> Thanks,
> Igor.
>
>
Preview a Report in Design Mode (VS 2005)
I am working with SQL Server Reporting Services and Visual Studio .Net 2005 Beta 2. In VS 2003 you could preview a report in design mode by clicking on the preview tab. There is no such tab in 2005 Beta 2. Does anyone know how to preview a report in design mode? Thanks.When you are using the Report Controls in local mode (embedded), there is no preview since your application is responsible for creating the data set to bind into the control. You will need to execute your application to preview.
Designer preview is only present in report server mode.
Preview a Report in Design Mode (VS 2005)
I am working with SQL Server Reporting Services and Visual Studio .Net 2005 Beta 2. In VS 2003 you could preview a report in design mode by clicking on the preview tab. There is no such tab in 2005 Beta 2. Does anyone know how to preview a report in design mode? Thanks.When you are using the Report Controls in local mode (embedded), there is no preview since your application is responsible for creating the data set to bind into the control. You will need to execute your application to preview.
Designer preview is only present in report server mode.
Preview <> PrintPreview
Hi,
i created a report that works fine, in preview it shows 3 pages, but in
print preview it shows 4, i allready checked the sizes, Report.PageWidth is
21cm, left and right Margins are both with 1cm and body width is 18.75cm ...
so 21-1-1 = 19 that is great then 18.75... what i miss ?
rgards
JFRYou may want to check your object sizes in the layout view. I have found that
if the report layout is larger than the set pagesize that it will move the
extra space onto a blank page. In this case, make sure that the width of the
report in the layout view is 19 cm or less, preferably a little less. You
might also want to check the length and make sure that its not running over
there.
"JFR" wrote:
> Hi,
> i created a report that works fine, in preview it shows 3 pages, but in
> print preview it shows 4, i allready checked the sizes, Report.PageWidth is
> 21cm, left and right Margins are both with 1cm and body width is 18.75cm ...
> so 21-1-1 = 19 that is great then 18.75... what i miss ?
> rgards
> JFR
i created a report that works fine, in preview it shows 3 pages, but in
print preview it shows 4, i allready checked the sizes, Report.PageWidth is
21cm, left and right Margins are both with 1cm and body width is 18.75cm ...
so 21-1-1 = 19 that is great then 18.75... what i miss ?
rgards
JFRYou may want to check your object sizes in the layout view. I have found that
if the report layout is larger than the set pagesize that it will move the
extra space onto a blank page. In this case, make sure that the width of the
report in the layout view is 19 cm or less, preferably a little less. You
might also want to check the length and make sure that its not running over
there.
"JFR" wrote:
> Hi,
> i created a report that works fine, in preview it shows 3 pages, but in
> print preview it shows 4, i allready checked the sizes, Report.PageWidth is
> 21cm, left and right Margins are both with 1cm and body width is 18.75cm ...
> so 21-1-1 = 19 that is great then 18.75... what i miss ?
> rgards
> JFR
Subscribe to:
Posts (Atom)