Re: password protected database
Hi curio11,
I am not sure as to what platform you are working on. I am using VS.Net 2003 and using C#. Here is what I did to solve this issue:
Right before I set the dataSource for my report. I did this:
myReport report = new myReport();
string login = "UserID";
string passWd = "Password";
report.SetDatabaseLogon(login,passWd);
crystalReportViewer1.ReportSource = report;
This did it for me. I hope this helps.
Take care.
Adios!
Salmaan.
Password Protected Database
Hi
I am working with VB.net 2002 and MS-Access(password protected). Have created a DSN to work with Crystal Reports. Now the problem is that it does not accept the following line code
CrystalReportViewer1.LogOnInfo(0) = "DSN = ABC;UID = ;PWD = XYZ;DSQ = "
have searched the whole thread, the only solution i found is this piece of code but it does not work et all...
do i require to import any files?? i am importing CrystalDecisions.CrystalReports.Engine and CrystalDecisions.Shared
my code is:
Dim rptTransporter As New rptTransporterCostingRpt()
CrystalReportViewer1.LogOnInfo(0) = "DSN = ABC;UID = ;PWD = XYZ;DSQ = "
CrystalReportViewer1.ReportSource = rptTransporter
CrystalReportViewer1.Show()
Thanks in advance
Bye
How do i dynamically through MFC/VC++ add and remove fields in the crystal report?
How do i dynamically through MFC/VC++ add and remove fields in the crystal report?
Can I call a function WhileReadingRecords?
Hi,
I have the databse (Oracle) in Unicode (UTF8 encoding) and using reports 4.5. So I am not able to get the strings in the report. First of all, Does crystal report 9.0 works fine with UTF8 encoding backend? (now i get the string as UTF8 characters)
Now, to escape from upgrading to reports 9.0, I have another way. I can convert the Unicode characters to ASCII and use my own font to display and print. (The conversion and fonts are working properly.)
I want to call my converter while reading database (for every string value of every records). The front-end is VB6 and the coverters are functions written in VB6 (also used other dlls).
Can you guys help me to get a solution?
Thanx in advance.
Regards,
Mahesh
flattening the rows from database
I am reading a record grouped by name and then by project name from Sql server DB. The database has records based on year of week. But the report should be based on pay period(dates). I have the logic to filter the data based on input pay period range. I used array to stretch the 3 rows from DB to 1 report row using
if({TimeSheet.Week} = {@beginWk}) then
populate week1 array;
else if({TimeSheet.Week} = {@endWk}) then
populate week3 array;
else
populate week2 array;
TimeSheet.Week - is the databasew field
Then I form the finalHrarray by stretching week1, week2 and week3 based on the pay period range. But in the report under the detail section it displays 3 rows from the DB for the project
like
projectA 0 1 2 3 4 5 0 0 0 0 0 0 0 0 0
projectA 0 1 2 3 4 5 0 0 0 0 0 0 0 0 0
projectA 0 1 2 3 4 5 0 0 0 0 0 0 0 0 1
Somehow it reads only 1 and 3 row and in some case 1 and 2 row. But I want
projectA 0 1 2 3 4 5 0 5 6 7 2 3 0 0 1 All three weeks in 1 row
sql command parameter issue...
Please help Babu:
For a couple days I've been battling with writing a report that has to tables linked by a left outer join. The left table simply holds all possible hours of the day (00 - 23). The right table holds all of my data.
My report groups on the hour of the day and it needs to show every hour of the day regardless of whether there is data there or not. I tried a bunch of things but I finally came to the conclusion that crystal was creating my sql syntax incorrectly.
I think I found a work around. I'm using an access database. If I write my own sql command I got it to work. Apparently, crystal was creating the wrong syntax for my sql statement when I used the select expert.
Crystal was creating the following query:
SELECT holdertable_hours.startingtimehours, recordcontrolnumber
FROM holdertable_hours LEFT OUTER JOIN Master ON HolderTable_Hours.StartingTimeHours=Master.StartingTimeHours
Where Master.GroupUsed='083';
If I create a sql command and put the where clause in the join statement it worked:
SELECT HolderTable_Hours.StartingTimeHours, RecordControlNumber
FROM HolderTable_Hours LEFT JOIN [Select * From Master Where GroupUsed='083']. AS Master ON HolderTable_Hours.StartingTimeHours=Master.StartingTimeHours;
I have two questions though:
1) Is it possible to change the sql that crystal generates without writing my own sql command?
2) If I have to write my own sql command, is it possible to create a drop down list for my parameter field, Master.GroupUsed? Originally I was not writing my own command and I had a parameter field where I could select my value for GroupUsed from a drop down list. Now that I have my parameter field as part of my command, it appears that crystal is making me type in the GroupUsed value. It would be nice to still be able to use a drop down list.
Thanks again for all of your help on this!
Steph-