Quantcast
Channel: VBForums - Reporting
Viewing all 597 articles
Browse latest View live

Print Directly to Printer with RDLC Report

$
0
0
I am wondering how I can print directly to a printer with a local rdlc report instead of using the report viewer. Basically what I am trying to do is allow the user to push a button and print a report using the record that the user is currently viewing on the screen.

I have tried using the code on the MSDN http://msdn.microsoft.com/en-us/library/ms252091.aspx, but I get an error Variable 'warnings' is passed by reference before it has been assigned a value. A null reference exception could result at runtime. Which is this part of the code:
Dim warnings As Warning()
m_streams = New List(Of Stream)()
report.Render("Image", deviceInfo, AddressOf CreateStream, warnings)
For Each stream As Stream In m_streams
stream.Position = 0

So it won't run. Also the msdn sample code wants an XML file and I only have an xsd.

Can't believe this is so much work just to print the report without viewing it.

Any help you can provide would be much appreciated as I am new to vb.

Open Source RDL: My-FyiReporting

$
0
0
It appears that My-FyiReporting is the sole active fork of the old (now defunct) FyiReporting, so I've started a new thread to share my findings.

It seems to me that it has great promise if the potential users could be assured of continued development and support.
For those of us wishing to avoid the cost and complexity of full blown reporting options, this simple option may suit us perfectly. It just needs to gain a critical mass of followers to snowball onwards.

I have emailed the project maintainer Peter, and he says, promisingly :
"I am hosting my code https://github.com/majorsilence/My-FyiReporting and hopefully that will encourage some more active development from others.
I will generally only be fixing bugs that affect me or adding features that I need. However patches from others is very much encouraged."


Now, the good news is that it costs nothing to play with it. There are both .MSI and .ZIP downloads at
https://github.com/majorsilence/My-F...ting/downloads
and I unzipped 4.5.0-my-fyi-build-dot-net-4-x86.zip into a test folder and found that it works without installing or registering anything, so it won't work its tentacles into your setup if you're nervous about such things!

The zip file contains 18 files, a collection of .EXE and .DLL along with some config XML files. I'm ignoring the server and map stuff, as I just want to design a report and then make it appear from my vb.net app.

Designer : RdlDesigner.exe

The standalone designer loads the previously loaded report, or has a new report wizard. It looks like this:
Attachment 90315

In the wizard, I kept the default SQL option and dialled in a connection string like :
server=MYSERVER; database=MyTest; Integrated Security=SSPI
- and it connected straight away, and listed the tables and fields. It was easy to write a SELECT query, using a button to copy field names, and as if my magic my report was there, looking like it would suit my requirements perfectly. The report was saved to a .RDL file containing XML as follows-

Code:

<?xml version="1.0" encoding="UTF-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <Description>
  </Description>
  <Author>
  </Author>
  <PageHeight>11in</PageHeight>
  <PageWidth>8.5in</PageWidth>
  <DataSources>
    <DataSource Name="DS1">
      <ConnectionProperties>
        <DataProvider>SQL</DataProvider>
        <ConnectString>server=MYSERVER; database=MyTest; Integrated Security=SSPI</ConnectString>
      </ConnectionProperties>
    </DataSource>
  </DataSources>
  <Width>7.5in</Width>
  <TopMargin>.25in</TopMargin>
  <LeftMargin>.25in</LeftMargin>
  <RightMargin>.25in</RightMargin>
  <BottomMargin>.25in</BottomMargin>
  <DataSets>
    <DataSet Name="Data">
      <Query>
        <DataSourceName>DS1</DataSourceName>
        <CommandText>SELECT field1, field2 FROM table1</CommandText>
      </Query>
      <Fields> .... etc...

RdlReader.exe

A report viewer control may be added your VB forms, but there is also a standalone reader. So I have been able to load an RDL file into that and there is my report.
This is looking good, IMHO, I will keep you updated as I go...

Reminder
This is Open Source under the Apache License, Version 2.0 ( http://www.apache.org/licenses/LICENSE-2.0 ) so you can use it in your project and supply it to customers.
Helpful documentation from the original project can be found at http://fyireporting.com/helpv4/
along with Peter's newer wiki at https://github.com/majorsilence/My-FyiReporting/wiki
Attached Images
 

Error 20544 in Crystal Reports on a certain XP computer

$
0
0
I have the same VB5 program using crystal reports installed on 3 different computers for testing. Two XP computers and one Win7 computer.

When the database and Crystal Reports are located on one of my XP computers, I get the 20544 Error message when I try to run a report over the network from either of the other 2 computers. When I put the database and Crystal Reports on either of the other 2 computers(XP or Win7), the Crystal reports print just fine when accessed over the network.

The crystal reports print fine on the problem XP computer if they are run from that computer and not over the network.

It seem to me that I am missing a file or DLL on the problem computer, but WHAT?

Would appreciate HELP!!

Error of Password in Crystal Report

$
0
0
I make crosstab crystal report and then want to display it through vb, it display error
Attachment 90371
I am using
Crystal Report 9
Visual Basic 6
Attached Images
 

[RESOLVED] Reportparameter: "Overload resolution failed"

$
0
0
im new to reporting and im following a tutorial

http://www.youtube.com/watch?v=psLVb...eature=related

however im using my own table and also my personal controls, namely reportviewer1, Textbox1, and Button1

at 9:56, he placed the name of one of the objects for filtering the records, namely MM and YY. i tried mine and i got this:


may i know what am i doing wrong? :(

edit: scratch that, i forgot to place the .text at the and but there was another error, how do i delete this thread?
Attached Images
 

Run existing Crystal Report in VB.NET

$
0
0
I have an existing Crystal report built (using Crystal Reports), and I want to be able to share it with other users who don't have Crystal installed. Actually, I want them to be able to run it themselves. I figure the best way to do that is to setup a little VB.NET app that calls the report and sends a few parameters like date, llocation - whatever.

I know there is a Crystal Reports "viewer" in VS 2010 but I'm not sure how to use it to run my report. I've found a couple of examples online but I must be missingsomething. This one in particular seems pretty good, but myVB doesn't like the code snippet highlighted in bold below:

Imports CrystalDecisions.CrystalReports.Engine
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim cryRpt As New ReportDocument
cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
End Sub
End Class

Any help/insight is appreciated. Oh - and I'm putting in the actual path/file name for my file in the program - not using "PUT CRYSTAL PATH HERE" as shown above!

When having a record characters more that 26000 cdoRecordSet.AddRows reportData gives

$
0
0
Attachment 90543


I provide data in to vb code through xml as follows

<?xml version="1.0" encoding="ISO-8859-1"?>
<Report>
<Configuration>
<Printer>Default</Printer>
<Tray>Default</Tray>
<ShowPreview>true</ShowPreview>
<Copies>1</Copies>
<PDFFile></PDFFile>
</Configuration>
<Tables>
<MainTable>
<Row>
<Field_0>
<FieldName>ColumnTwo</FieldName>
<Data>wwwwww.............(26000 charactes)</Data>
</Field_0>
<Field_1>
<FieldName>ColumnTwo3</FieldName>
<Data>....</Data>
</Field_1>
.
.
.
.
.
</Row>
</MainTable>
</Tables>
</Report>

whenever i provide the xml large number of data (more than 26000 characters) i am getting error Method 'AddRows' of object 'ICrystalDataObject' failed

does any one know why this happens. is there a particular data length for a row or a field of crystal report.
Attached Images
 

vb.net bind/rebind data source to reportviewer at runtime?

$
0
0
how do we bind/rebind data source to reportviewer at runtime?

i cannot create report

$
0
0
Hi I am new to crystal report

I use mysql for database

so I try to create new report using report wizard and go to create new connection to connect to database and I dont know where to go next from here to connect to mysql database. please help

vb+ cr 8.5 open report

$
0
0
link to my other post related to crystal report http://www.vbforums.com/showthread.p...77#post4219177

moreover, i have created rpt using cr 8.5 and i use mysql db with mysql odbc 5.1 that means I used odbc but when I deleted the odbc file for its connection, it will look for that file or establish again the connection.

how will i do that I dont need to create the odbc dsn file. this is important if I need to open the rpt upon distribution.

vb and crystal reports 10

$
0
0
I am using crystal reports version 10 and vb6 and mysql database

I am connecting with crystal reports using connectionstring and not odbc.

I intend to use connectionstring.

I am using reference crystal reports activex designer run time library 10.0
and component is crystal activex report viewer library 10.0

what I do to open rpt report with vb6 is

1. open database connection
2. open recordset

Set crApp = New CRAXDRT.Application
Set crReport = crApp.OpenReport(App.Path & "\report.rpt")

crReport.DiscardSavedData
crReport.Database.SetDataSource rs
crReport.RecordSelectionFormula = strfilter
Form2.crviewer.ReportSource = crReport
Form2.Show
Form2.WindowState = vbMaximized
Form2.crviewer.ViewReport

however, I am getting error attached here.
Attached Images
 

Modifying an RPT in CR9 that was created by exporting as RPT from VB6 IDE

$
0
0
Hi

I am really stuck trying to do the above. I keep getting an error "object doesn't support this property or method" when I reference the modified report in my VB6 app. If I do not modify the RPT file from inside the CR9 app and run the RPT file as it is saved from the VB6 IDE, then report runs fine.

Does anyone have any idea on this?

Many thanks.

Problem with iif expressionstatement in rdlc

$
0
0
I am using the following expression:
=Fields!job_number.Value
It gives either a number or blank.

I want it to give a number or '0' if it is blank.

Therefore I have used the following expression:
=iif(Fields!job_number.Value="",0,Fields!job_number.Value)

This is displaying en error instead of a number, and 0 if it is blank.

I don't know why it is displaying an error.
The filed is numeric, and the format for display is numeric.

send crystal report4.6 via vb6

$
0
0
Hi
when I designed an report by crystal report 4.6 in vb6 I can send the report as attached file via email, but when I preview the report thtough the application the MAPIMessages and MAPISession buttons not work ?! I need to solve this problem to help me for send the report via email
thank's for every help

Sub Report in VS2010

$
0
0
Dear All,
I have to display 2 reports in VS2010 as one. So what I am using is sub-report. but the thing is I don't know how to display data from my db in the sub report. please see code below.
Code:

Dim rptdoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
                        rptdoc = New CrystalReport2 'main report
                        Dim rptdoc2 As CrystalDecisions.CrystalReports.Engine.ReportDocument
                        rptdoc2 = New CrystalReport3 'sub report

                        Dim localid As TextObject = rptdoc.ReportDefinition.ReportObjects("Text6")
                        localid.Text = DataGridView1.Item(0, i).Value.ToString 'textbox on main report
                        Dim localid2 As TextObject = rptdoc2.ReportDefinition.ReportObjects("Text13")
                        localid2.Text = DataGridView1.Item(0, i).Value.ToString 'textbox on sub report
                        Dim barcode As TextObject = rptdoc.ReportDefinition.ReportObjects("Text8")
                        barcode.Text = "*" & DataGridView1.Item(0, i).Value.ToString & "*"
                        Dim date1 As TextObject = rptdoc.ReportDefinition.ReportObjects("Text5")
                        date1.Text = Date.Now.ToShortDateString
                        objdataset = New DataSet
                        sqldataAdapter = New SqlDataAdapter
                        sqldataAdapter.SelectCommand = New SqlCommand
                        sqldataAdapter.SelectCommand.Connection = objconnection
                        sqldataAdapter.SelectCommand.CommandText = "Select NameAddofAdd from [" & cagenumber & "] where LocalID='" & DataGridView1.Item(0, i).Value.ToString & "'"
                        objconnection.Open()
                        sqldataAdapter.Fill(objdataset, cagenumber)
                        objconnection.Close()
                        Dim namenaddress As TextObject = rptdoc.ReportDefinition.ReportObjects("Text10")
                        namenaddress.Text = objdataset.Tables(0).Rows(0).Item(0).ToString
                        Dim f As New ViewPS94
                        f.CrystalReportViewer1.ReportSource = rptdoc
                        f.Show()

the data to be displayed on the textbox for the sub report is not appearing. please advise.
thanks
ashley

Changing Crystal Report Font Programmatical

$
0
0
I use this code to change the font programmatically

Code:

                            Dim newFont As New Font("Arial", 10, FontStyle.Bold)
                            CType(.Section2.ReportObjects("TextBox1"), Object).Font = newFont


but the error is:

Property 'Font' is ReadOnly.

what should I do?

grouping in rdlc

$
0
0
i have a database with the following attributes


ORNUMBER pk
Registration
Textbooks
ID
Medical
Dental
Testpaper

how do i pull of the image below?
Attached Images
 

How do I change the color of a rdlc textbox

$
0
0
I'm using a rdlc report within a VB project.

I have a text field 'surname' and a boolean field 'sales'.

Depending on the value of the boolean field I want the text to be displayed in red or black.

Looking at examples I should be changing the text color.

But the label on the dialog box when I select 'expression' says 'Set expression for:Value' but I think I should be a able to select to set the expression for color.

I have the following expresion but it just displays the text "Black" and "Red" in the text box.

=iif(fields!sales.Value,"Black","Red")

Opening Crystal Report using IPAddress

$
0
0
We are developing a Extra net software application using vb6 & firebird as database and crystal reports 10 as reporting tool. we have a centralized server having a static ip address. All the client connect to this server using vb6 application for data access using any type of internet connection such as broadband, dialup, wifi etc and this works fine.
We want to having all the crystal reports file in the same centralized server because we do not want to distribute then to all the clients, but they must access the reports from vb6 application.

All the runtime files for accessing the CR will be installed in the client using the merge modules.

But we are not able to open the crystal reports file, using report.openreport() function.
This function is working for only local physical path.
Please someone help us.

Sum by Date

$
0
0
I am relatively new to Crystal however I am pretty far along on what I want to achieve. I have created several formulas and have them working properly. I am currently trying to have several sums based on several different time periods for a field.

So I have a formula to get the value for the field based off of a input date when the report is ran. Then I made several formulas (one for the first day of each month and one for the last day of each month) so I could have the ranges auto populate based off of those fields.

Here is a look at structure for 11 months back range

@11BackBeg Gives first day of the month
Code:

Local DateTimeVar d := {TimeRecord.ActualDateTime};
DateSerial(Year(d), Month(d) - 0 - 11, 1)

@11BackEnd Gives last day of the month
Code:

Local DateTimeVar d := {TimeRecord.ActualDateTime};
DateSerial(Year(d), Month(d) - 0 - 10, 0)

@11Back Time puts them into a usable formula
Code:

{TimeRecord.OwnedBy} = {?AS Team Member} and
{@ActualDate} in {@11BackBeg} to {@11BackEnd}

Now I need to display the proper info using @11Back Time
I know I need to use Sum but I am unsure how to incorporate the @11Back Time into it.
Code:

Sum ({@F AdminTime}, {TimeRecord.OwnedBy})
Suggestions?
Viewing all 597 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>