Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts

Friday, March 30, 2012

putting image on Crystal Report

Is there any Facility in Crystal Report 9 to Insert image on Crystal report Dynamically... from Database?
Is there any image/Picture control available
please reply me regarding thisHi!
Followinng is how to load picture in Cr from some path dynamically.

for that you will have to do thid

1. Include Crystal Report Designer in to VB
2. add a picture to Detail section of Report
3. double click Detail seciton and code this

Set Picture1.FormattedPicture = LoadPicture(Filepath)

i have used it with Cr8.5.

Friday, March 23, 2012

push data to crystal report asp.net

I am attempting to use the push model for a crystal report from a asp.net project.
I am having two problems. First when I attempt to use a sql command I am able to create the report
but when I attempt to push the data to it I get a login failed error. When I correct this I get the original
data that was used to format the report not the modified data that I am attempting to push to it.
Here is the code.

Sub BindReport2()
Dim oRpt As New CrystalReport1

Dim myConnection As New SqlClient.SqlConnection
myConnection.ConnectionString = "Server=WOODS1;Database=WEB_TEST;User ID=WebRep;Password=webrep;Trusted_Connection=False"
Dim MyCommand As New SqlClient.SqlCommand
MyCommand.Connection = myConnection
MyCommand.CommandText = "select fname, lname, address1, city, state " & _
"from T1, T2 " & _
"where T1.empid = T2.empid and state = 'New York' "

MyCommand.CommandType = CommandType.Text
Dim MyDA As New SqlClient.SqlDataAdapter
MyDA.SelectCommand = MyCommand
Dim myDS As New DataSet
'This is our DataSet created at Design Time
MyDA.Fill(myDS, "Command")
'You have to use the same name as that of your Dataset that you created during design time

'oRpt.Database.Tables.Item("Command").SetDataSource(myDS)
' This is the Crystal Report file created at Design Time
oRpt.SetDataSource(myDS)
' Set the SetDataSource property of the Report to the Dataset
CrystalReportViewer1.ReportSource = oRpt
'oRpt.SetDatabaseLogon("user","password","server","database")
oRpt.SetDatabaseLogon("WebRep", "webrep", "WOODS1", "web_test")
CrystalReportViewer1.RefreshReport()

' Set the Crystal Report Viewer's property to the oRpt Report object that we created
End Sub

My Second issue is similar though involves using a dataset. I am able to push the data to the report if
my dataset only contains one table if it contains more than one I get no data returned to the report.
Here is the code.

Sub BindRep()
Dim oRpt As New CrystalReport2
Dim myConnection As New SqlClient.SqlConnection
myConnection.ConnectionString = "Server=WOODS1;Database=WEB_TEST;User ID=WebRep;Password=webrep;Trusted_Connection=False"

Dim strSQL As String = "select fname, lname, address1, city, state " & _
"from T1, T2 " & _
"where T1.empid = T2.empid and state = 'New York' "

Dim objAdapter As New SqlClient.SqlDataAdapter(strSQL, myConnection)

Dim objDataSet As New Dataset1
objAdapter.Fill(objDataSet, "T1, T2")

oRpt.SetDataSource(objDataSet)
' Set the SetDataSource property of the Report to the Dataset
CrystalReportViewer1.ReportSource = oRpt
End Sub

I have been able with the above code using a dataset that contains only one table to push the correct data
to the report. Any help on this issue whould be greatly appreciated.I dunno what database you're using, but I would have thought your problem occurs becuse of your SQL syntax/structure, where's your:
AS T1 INNER JOIN T2 ON (T1.empid = T2.empid )
???

If you don't join them on at least one field, the SQL parser can't resolve the WHERE clause.

Davesql

Tuesday, March 20, 2012

Pulling Dates 14 days or more past

Does anyone know a way to get Crystal to look for dates 14 days or more past a given date? I'm using Crystal reports 9 and I've tried using the DateDiff function like so.

DateDiff("d",{?StartDate},{Command.RecDate})<=14

but I'm not getting the results I want. I also tried using it in an SQL command query in my original selection with no luck any ideas?got it resolved thank you.|||In the record selection for your Crystal Report (http://www.shelko.com) you can use a formula similar to:

{myDate} >= ({?Start Date}+14)

Friday, March 9, 2012

Publishing Crystal Reports in Web

Hi,

I'm using CR9. Planning to publish them in the web. Used ASP to publish them

But Is it necessary to instal CR 9 in the server.

My CreateObject("CrystalRuntime.Application.9") Failed because of Invalid ProgId Error.

Have any idea pls tell me,

ThanksI don't know anything about Crystal Reports for the Web, but I think Crystal Enterprise was created for that. Try a search on that for your answer.|||It's working. Installed crystal reports and its corresponding web components.

Anyway, thanks for your response

Publishing CR .rpt file into SSR

I have some crystal reports .rpt files that I'd like to publish to users via
the SSR menu. Is there anyway to do this?
THanks
--
DougThere is nothing built into the product to convert crystal reports to RS
reports. There is at least one consulting company that will convert reports
for you.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Doug Little" <littldo@.yahoo.com.(donotspam)> wrote in message
news:615C9F22-3E66-403B-A762-E3C8D08E4C43@.microsoft.com...
>I have some crystal reports .rpt files that I'd like to publish to users
>via
> the SSR menu. Is there anyway to do this?
> THanks
> --
> Doug