[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Passing parameters from C++ to Brio Reports



Kevin,

Try concatenating the values of the variables into one long
command line instead of putting the names of the variables there.
I'm pretty sure that this will work.  I'm not sure, but if
the values for subject, title, name, and org contain spaces,
you may need to cause double-quotes or single-quotes to appear
around them.

Ray

> I am having a silly problem trying to pass variables to Brio. I have a 
>C++/MFC program that accepts 4 character strings. I want to pass them to a 
>Brio report. I have tried two ways of passing them
> 1) with the sqrw.api looks like this
> int status;
> status = sqr("C:\\myquery.sqr   user/password@database  -A -NOLIS -ZIV 
>subject title name org ");
> where subject title name and org are variable names for the character strings
> or
> 2) by using the windows api directly
>
> LPCTSTR pcszParam = _T("C:\\myquery.sqr user/password@database  -A -NOLIS 
>-ZIV subject title name org ");
> LPCTSTR pcszDir = _T("C:\\Program Files/Microsoft Visual 
>Studio/Projects/myquery/myquery.sqr");
> ShellExecute(AfxGetMainWnd()->m_hWnd,"open","sqrw.exe", pcszParam, pcszDir, 
>SW_SHOW);
>
> The problem with both of these is that Brio accepts the variable names as 
>character strings not as a variable name and Brio reports that no records were 
>found where subject = SUBJECT etc
>
> I tried using escape characters and pointers but it doesn't make a 
>difference. A similar procedure in Oracle Forms has the same syntax and works 
>fine.
>
> I could try writing the values of the variables to a text file and then 
>passing them to Brio but this seems clumsy at best.
>
> All suggestions appreciated.
>
> Brio Report Builder 5.1 build 45/Windows 98 SE/Oracle 8 Database
>
>
> Thank you
>
> Kevin LaRoche
> Ottawa, Ontario Canada
>

----------------------------------------------------------------------
Ray Ontko   rayo@ontko.com   Phone 1.765.935.4283   Fax 1.765.962.9788
Ray Ontko & Co.   Software Consulting Services   http://www.ontko.com/