Page 1 of 1

Need Guidance Please

Posted: Thu May 05, 2016 7:38 am
by hemantpandya
Hi All,

It's me again need guidance. How to use harbour side variable in FRH.
trying with following code but unable to add variable to Report Variable list.

Please guide me.

Thanks in advance

Regards
Hemant
Sydney - Australia

MY code
function create_report()

use group shared new
set orde to 1

vCmpName := "ABC Company Pty Ltd" //<<- want to this variable in report
vCmpCity := "Sydney" //<<- want to this variable in report

WITH OBJECT oReport := TFastReport():New()

:AddDbf( "group", { "group->*" } )
:AddVariable("Company", vCmpName)
:AddVariable("City", vCmpCity)
:Create()
:DesignReport()
:End()
END WITH

retu

Re: Need Guidance Please

Posted: Thu May 05, 2016 10:32 am
by ignacio
Try to put the method Create() first.

Regards,

Re: Need Guidance Please

Posted: Fri May 06, 2016 6:26 am
by hemantpandya
Hi Ignacio,

Thanks for guidance but that did not help.

Regards
Hemant

Re: Need Guidance Please

Posted: Fri May 06, 2016 9:22 am
by ignacio
Sorry you must create the category first:

Code: Select all

:AddCategory( "personal" )
:AddVariable( "test", 123 )


Regards,

Re: Need Guidance Please

Posted: Sun May 08, 2016 3:40 am
by hemantpandya
Hi Ignacio,

Tried as per your instructions but no luck did not see any Category or Variable in Report designer under Variable Tab.

I creating report using Designer but it generated reports for 4 Pages only (No Watermarks).

Please guide me.

Regards
Hemant
Sydney -Australia
my code
function create_report()

use group shared new
set orde to 1

vCmpName := "ABC Company Pty Ltd" //<<- want to this variable in report
vCmpCity := "Sydney" //<<- want to this variable in report

WITH OBJECT oReport := TFastReport():New()
:AddDbf( "group", { "group->*" } )
:Create()
:AddCategory("Personal")
:AddVariable("Company", vCmpName)
:AddVariable("City", vCmpCity)

:DesignReport()
:End()
END WITH

retu

Re: Need Guidance Please

Posted: Mon May 09, 2016 9:32 am
by ignacio
Hello,

I creating report using Designer but it generated reports for 4 Pages only (No Watermarks).

2016-05-09 09_27_05-Ayuda de HTML.png
2016-05-09 09_27_05-Ayuda de HTML.png (11.4 KiB) Viewed 2961 times


About the variables issue: I have just modified our FR console demo with this code:

Code: Select all

FUNCTION BioLife()
   LOCAL oReport
   .....
   WITH OBJECT oReport := TFastReport():New()
      ......
      :Create()
      ......
      :AddCategory( "personal" ) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      :AddVariable( "test", 123 ) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ......
   END WITH
   .....


And ...
2016-05-09 09_31_21-FastReport - Biolife.fr3.png
2016-05-09 09_31_21-FastReport - Biolife.fr3.png (5.36 KiB) Viewed 2961 times


Regards,

Re: Need Guidance Please

Posted: Wed May 11, 2016 7:32 am
by hemantpandya
Hi Ignacio

Thanks for your guidance for report (4 Page Problem) that's works perfect

but still I am not able to add the variable. I am using Harbour/Mingui

Harbour 3.2.0dev (r1406271520)
Copyright (c) 1999-2014, http://harbour-project.org/
Compiling 'con_frh.prg'...
Lines 13070, Functions/Procedures 2
Generating C source output to 'con_frh.c'... Done.

C:\Akola_Changes\oohg_new\FRH_Report\Trial>

Operating System

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

Also tried on Windows 8, Windows 7, Win XP and tried to compile with

and when trying to compile with Harbour/BCC and getting following error

C:\MiniGUI\SAMPLES\BASIC\FRX_Test>call ..\..\..\batch\compile.bat grp_dtl
Harbour 3.0.0 (Rev. 16950)
Copyright (c) 1999-2011, http://harbour-project.org/
Compiling 'grp_dtl.prg'...
Lines 20545, Functions/Procedures 3
Generating C source output to 'grp_dtl.c'... Done.
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
grp_dtl.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_HB_FUN___BREAKBLOCK' referenced from C:\MINIGUI\HARBOUR\LIB\XAFRHBCC.LIB|iFastReport
Link error.

If required please let me know I will send you PRG/BAT/DBF Files for your review.

Please guide me.

Regards
Hemant

My Consol mode code
#include "oohg.ch"
#include "i_color.ch"
#include "frh.ch"

ANNOUNCE HB_GT_SYS
REQUEST HB_GT_WVT_DEFAULT

*----------------------------------------------------------------------------------*
Function Main()
*----------------------------------------------------------------------------------*
LOCAL oReport

SetMode( 25, 80 )
SetColor( "N/W" )
CLS

@ 10,10 say 'Hello'
use group shared new
set orde to 1


vCmpName := "ABC Company Pty Ltd" //<<- want to this variable in report
vCmpCity := "Sydney" //<<- want to this variable in report

WITH OBJECT oReport := TFastReport():New()
:Create()
:AddCategory( "Personal" )
:AddVariable( "Company", vCmpName )
:AddVariable( "City", vCmpCity )

:AddDbf( "group", { "group->*" } )

:DesignReport()
:End()
END WITH
Return nil

Re: Need Guidance Please

Posted: Wed May 11, 2016 10:19 am
by ignacio
Hello,

There must be a report loaded and its not a FRX limitation but a FR limitation. Just create an empty report and loaded it first. It should work.

Regards,

Re: Need Guidance Please

Posted: Fri May 13, 2016 4:06 am
by hemantpandya
Hi Ignacio,

Thanks for all your help and guidance but no luck.

I tried to generate report from scratch but no luck.

Trying to compile with Harbour/MiniGUI/BCC and getting following error

C:\MiniGUI\SAMPLES\BASIC\FRX_Test>call ..\..\..\batch\compile.bat grp_dtl
Harbour 3.0.0 (Rev. 16950)
Copyright (c) 1999-2011, http://harbour-project.org/
Compiling 'grp_dtl.prg'...
Lines 20545, Functions/Procedures 3
Generating C source output to 'grp_dtl.c'... Done.
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
grp_dtl.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external [b]'_HB_FUN___BREAKBLOCK'[/b] referenced from C:\MINIGUI\HARBOUR\LIB\XAFRHBCC.LIB|iFastReport
Link error.

Please guide me which LIB I am missing.

Regards
Hemant

Re: Need Guidance Please

Posted: Wed May 10, 2017 11:09 am
by anser
Hi Hemant,

Were you able to resolve the AddVariable Issue ?

I too face the same issue. The variables added via oFr:AddVariable() does not appear in the FastReport

Re: Need Guidance Please

Posted: Wed May 10, 2017 1:33 pm
by ignacio

Code: Select all

   ::oFastReport1:AddVariable("VAR1", "this is a test")
   ::oFastReport1:ShowReport()


This is working nicely on any FR sample.

Regards,