Click to See Complete Forum and Search --> : Crystal Report
psmani
September 25th, 2001, 06:54 AM
Hi..
I am using Crystal Report 8.5 for my reports. I am facing one problem...for designing the reports it requires the database to be selected.. which means we are hotcoding the database path.. Is it right or what step should i follow .if any suggestions and answers mail me..
Regards
Manikandan
K.Babu
September 28th, 2001, 06:16 AM
hi
VB crystal report control by default search .exe directory, so copy all .rpt files in .exe directory, you can assign only reportfile name you don't need to specify any path itself.
if u had any problem mail me
k_babs@hotmail.com
Babu
MailID: k_babs@hotmail.com
DeafBug
September 28th, 2001, 12:13 PM
If you are using Crystal OCX file, you can specify the database path and tables, etc.
If you are using Crystal Automation DLL, your best bet is to pass a recordset to it. Of course you will open the database and tables, etc. in VB.
Rita Leoci
November 2nd, 2001, 10:11 AM
I use this function to change at runtime the server of the report.
My design server is like WJCG00000, the user server (for the runtime application) is like WJCG00101
long FCGetServer(char *String)
{
char *comodo = " ";
unsigned int i, len, j;
len = 0;
while (String[len] != '\0')
{
len++;
}
if (len-5 > 0)
{
j=0;
for (i = len-5; i <= len; i++)
{
comodo[j] = String[i];
j++;
}
// report with WJCG00000
if (strcmp(comodo,"00000") == 0)
{
return ((long) -1);
}
else
{
return atol(comodo);
}
}
else
{
return 0L;
}
}
//*******************************************************************************
BOOL FCSetServer(short job, const char *currname)
{
int numtable;
short currtable;
struct PELogOnInfo logOnInfo;
CString NewServerName,comodo;
comodo = currname;
NewServerName = "WJCG"+comodo;
numtable = PEGetNTables(job);
for (currtable=0; currtable < numtable; currtable++)
{
// Initialize size of structure
logOnInfo.StructSize = PE_SIZEOF_LOGON_INFO;
if (PEGetNthTableLogOnInfo(job, currtable, &logOnInfo) == FALSE)
{
return FALSE;
}
if (FCGetServer(logOnInfo.ServerName) != 0)
{
// is the server for the user lstrcpy(logOnInfo.ServerName, NewServerName.GetBuffer(10));
if (PESetNthTableLogOnInfo(job, currtable, &logOnInfo, FALSE) == FALSE)
{
return FALSE;
}
}
}
return TRUE;
}
/
From the application use:
if (FCSetServer(job,"00101") == FALSE)
{
// error
}
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.