crystal report promt for database login => Why?

  • Thread starter Thread starter Michael S
  • Start date Start date
M

Michael S

only my server get the report whitout the dialogue database login.
I think it is where the database is localhost and the crystal report know
not the connection string.

how I can crystal reports say where the database is?


Have anywhere a idee how a can fix this?

thank you

michael schindler
 
Hi Michal,

This is the code I'm using, it works great IF it the datasource is a SQL
server, as we speek( or as I write ;) ) I'm been unable to get the thing
going on a dataset, but it works great on a SQL backend. The thing is that
you have to set the db info using code, when you do that you are ok.

Here is the code basically what you do is set the logon info on all the
tables of the report

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
ConnectionInfo crConnectionInfo = new ConnectionInfo();

crConnectionInfo.ServerName = "127.0.0.1";

crConnectionInfo.DatabaseName = "CTP";

crConnectionInfo.UserID = "test";

crConnectionInfo.Password = "test";

foreach (CrystalDecisions.CrystalReports.Engine.Table table in
reportDocument1.Database.Tables)

{

TableLogOnInfo crTableLogonInfo = new TableLogOnInfo();

crTableLogonInfo.TableName = table.Name;

crTableLogonInfo.ConnectionInfo = crConnectionInfo;

crTableLogonInfos.Add( crTableLogonInfo);

table.ApplyLogOnInfo( crTableLogonInfo);

}

CrystalReportViewer1.LogOnInfo = crTableLogonInfos;
 
thank you

i'm very happy.

where i can set the logon info?
You have write on all the tables of the report?
Please can you me that a few explain more in detail?

thanl you

michael schindler

Please my english is very bad but i give my best that you me understand => I
hope :-)
 
Hi Michael,

I set the logoninfo in the page load handler, before the call to DataBind()

It seems that you have to set the logon info on ALL the tables in the
report ( the code I sent do that ) , you see as far as today I have been
having lot of problems with CR, no matter what I do i'm not been able to run
the report using a dataset as source. and it seems that this is a common
problem with the .net version of CR.

If you have any further problems do not hesitate in post it and I will
answer if I know the solution and never mind in regards of the language, the
english is not my first language neither :)

Pd:
You could get a GOOD knowledge of CR form this link:
http://www.crystalreportsbook.com/

Hope this help,
 
Back
Top