support.activereports.general

Started by webadmin@datadynamics.com at 08-07-2003 12:00 AM. Topic has 4 replies.

Print Search
Sort Posts:    
   08-07-2003, 12:00 AM
webadmin@datadynamics.com is not online. Last active: 12/13/2005 3:53:57 AM webadmin@datadynamics.com

Not Ranked
Joined on 12-12-2005
Posts 0
Dynamic field positioning
Originally Posted By: Eric Law<nospam@here.com>

Hello all!

I'm creating a report using ActiveReports 2 and VB6.

What I need to do is, on the fly, position a field based on the width of the text in an adjacent field.

The report concerns stocks, and it's supposed to print the company name (left-justified), and the ticker symbol immediately to the
right of the name in a different font. Because the fonts are different, I figure the thing to do is use separate fields for each
item. But the ticker field needs to be positioned on the fly so it's always just to the right of the company name, the length of
which varies. I can't do a calculation like len(companyName) because it's a proportional font and the width of the text is not
entirely related to the number of characters.

Any ideas?

Eric Law
Weiss Ratings



   Report 
   08-07-2003, 12:00 AM
webadmin@datadynamics.com is not online. Last active: 12/13/2005 3:53:57 AM webadmin@datadynamics.com

Not Ranked
Joined on 12-12-2005
Posts 0
Re: Dynamic field positioning
Originally Posted By: Shaun Pow<REMOVEispacjunk@ispac.com>


Eric,

Maybe look at the Rich Edit control - might be an easy way to do it. do a
sample up in word and save it as a RTF file - open up the file and see what
coding is required. use the TextRTF property. might be easier than
calculating the text size etc.

Shaun
--
"Eric Law" wrote in message
news:$VA#0UOXDHA.1896@dynaweb.datadynamics.com...
> Hello all!
>
> I'm creating a report using ActiveReports 2 and VB6.
>
> What I need to do is, on the fly, position a field based on the width of
the text in an adjacent field.
>
> The report concerns stocks, and it's supposed to print the company name
(left-justified), and the ticker symbol immediately to the
> right of the name in a different font. Because the fonts are different, I
figure the thing to do is use separate fields for each
> item. But the ticker field needs to be positioned on the fly so it's
always just to the right of the company name, the length of
> which varies. I can't do a calculation like len(companyName) because it's
a proportional font and the width of the text is not
> entirely related to the number of characters.
>
> Any ideas?
>
> Eric Law
> Weiss Ratings
>
>



   Report 
   08-07-2003, 12:00 AM
webadmin@datadynamics.com is not online. Last active: 12/13/2005 3:53:57 AM webadmin@datadynamics.com

Not Ranked
Joined on 12-12-2005
Posts 0
Re: Dynamic field positioning
Originally Posted By: Shaun Pow<REMOVEispacjunk@ispac.com>


Eric,

here's a sample...

Looks ugly but just have to substitute the "ABC Gadgets Inc: " for the
company and " $22.45" for the stock price.

Me.RichEdit1.TextRTF = "{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS
Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss\fprq2
Arial;}{\f3\froman Times New
Roman;}}{\colortbl\red0\green0\blue0;}\deflang1033\pard\plain\f3\fs20 ABC
Gadgets Inc: \plain\f2\fs24 $22.45\plain\f3\fs20\par }"

Word pad is easier than word as word seems to use more useless codes. still
some useless codes in the version above - i'm sure it can be made much
simpler.

familiar with it because i've been using the control to paste together 2 rtf
files in a recent project.

shaun



---------------------------------------
"Shaun Pow" wrote in message
news:wD8ETaSXDHA.2012@dynaweb.datadynamics.com...
>
> Eric,
>
> Maybe look at the Rich Edit control - might be an easy way to do it. do a
> sample up in word and save it as a RTF file - open up the file and see
what
> coding is required. use the TextRTF property. might be easier than
> calculating the text size etc.
>
> Shaun
> --
> "Eric Law" wrote in message
> news:$VA#0UOXDHA.1896@dynaweb.datadynamics.com...
> > Hello all!
> >
> > I'm creating a report using ActiveReports 2 and VB6.
> >
> > What I need to do is, on the fly, position a field based on the width of
> the text in an adjacent field.
> >
> > The report concerns stocks, and it's supposed to print the company name
> (left-justified), and the ticker symbol immediately to the
> > right of the name in a different font. Because the fonts are different,
I
> figure the thing to do is use separate fields for each
> > item. But the ticker field needs to be positioned on the fly so it's
> always just to the right of the company name, the length of
> > which varies. I can't do a calculation like len(companyName) because
it's
> a proportional font and the width of the text is not
> > entirely related to the number of characters.
> >
> > Any ideas?
> >
> > Eric Law
> > Weiss Ratings
> >
> >
>
>



   Report 
   08-08-2003, 12:00 AM
webadmin@datadynamics.com is not online. Last active: 12/13/2005 3:53:57 AM webadmin@datadynamics.com

Not Ranked
Joined on 12-12-2005
Posts 0
Re: Dynamic field positioning
Originally Posted By: Eric Law<nospam@here.com>

Shaun,

Thanks! That worked like a champ. I had intially thought using the richedit would be too complicated, but it wasn't as bad as I
expected. And of course, positioning controls on the fly ain't exactly simple either!

Good tip on WordPad, too - in the past I'd used Word and looked up codes myself. Guess it would be too easy if DD just documented
what codes the RE control supports, huh? ;^)

Eric Law

"Shaun Pow" wrote in message news:RtkjigSXDHA.1896@dynaweb.datadynamics.com...
>
> Eric,
>
> here's a sample...
>
> Looks ugly but just have to substitute the "ABC Gadgets Inc: " for the
> company and " $22.45" for the stock price.
>
> Me.RichEdit1.TextRTF = "{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS
> Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss\fprq2
> Arial;}{\f3\froman Times New
> Roman;}}{\colortbl\red0\green0\blue0;}\deflang1033\pard\plain\f3\fs20 ABC
> Gadgets Inc: \plain\f2\fs24 $22.45\plain\f3\fs20\par }"
>
> Word pad is easier than word as word seems to use more useless codes. still
> some useless codes in the version above - i'm sure it can be made much
> simpler.
>
> familiar with it because i've been using the control to paste together 2 rtf
> files in a recent project.
>
> shaun
>
>
>
> ---------------------------------------
> "Shaun Pow" wrote in message
> news:wD8ETaSXDHA.2012@dynaweb.datadynamics.com...
> >
> > Eric,
> >
> > Maybe look at the Rich Edit control - might be an easy way to do it. do a
> > sample up in word and save it as a RTF file - open up the file and see
> what
> > coding is required. use the TextRTF property. might be easier than
> > calculating the text size etc.
> >
> > Shaun
> > --
> > "Eric Law" wrote in message
> > news:$VA#0UOXDHA.1896@dynaweb.datadynamics.com...
> > > Hello all!
> > >
> > > I'm creating a report using ActiveReports 2 and VB6.
> > >
> > > What I need to do is, on the fly, position a field based on the width of
> > the text in an adjacent field.
> > >
> > > The report concerns stocks, and it's supposed to print the company name
> > (left-justified), and the ticker symbol immediately to the
> > > right of the name in a different font. Because the fonts are different,
> I
> > figure the thing to do is use separate fields for each
> > > item. But the ticker field needs to be positioned on the fly so it's
> > always just to the right of the company name, the length of
> > > which varies. I can't do a calculation like len(companyName) because
> it's
> > a proportional font and the width of the text is not
> > > entirely related to the number of characters.
> > >
> > > Any ideas?
> > >
> > > Eric Law
> > > Weiss Ratings
> > >
> > >
> >
> >
>
>



   Report 
   08-12-2003, 12:00 AM
webadmin@datadynamics.com is not online. Last active: 12/13/2005 3:53:57 AM webadmin@datadynamics.com

Not Ranked
Joined on 12-12-2005
Posts 0
Re: Dynamic field positioning
Originally Posted By: Shaun Pow<REMOVEispacjunk@ispac.com>

Eric,

Good news. If you decide to trim down the RTF - maybe you could post the
base RTF code required to do the task.

thanks
Shaun

"Eric Law" wrote in message
news:irrPbmaXDHA.1908@dynaweb.datadynamics.com...
> Shaun,
>
> Thanks! That worked like a champ. I had intially thought using the
richedit would be too complicated, but it wasn't as bad as I
> expected. And of course, positioning controls on the fly ain't exactly
simple either!
>
> Good tip on WordPad, too - in the past I'd used Word and looked up codes
myself. Guess it would be too easy if DD just documented
> what codes the RE control supports, huh? ;^)
>
> Eric Law
>
> "Shaun Pow" wrote in message
news:RtkjigSXDHA.1896@dynaweb.datadynamics.com...
> >
> > Eric,
> >
> > here's a sample...
> >
> > Looks ugly but just have to substitute the "ABC Gadgets Inc: " for the
> > company and " $22.45" for the stock price.
> >
> > Me.RichEdit1.TextRTF = "{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss
MS
> > Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss\fprq2
> > Arial;}{\f3\froman Times New
> > Roman;}}{\colortbl\red0\green0\blue0;}\deflang1033\pard\plain\f3\fs20
ABC
> > Gadgets Inc: \plain\f2\fs24 $22.45\plain\f3\fs20\par }"
> >
> > Word pad is easier than word as word seems to use more useless codes.
still
> > some useless codes in the version above - i'm sure it can be made much
> > simpler.
> >
> > familiar with it because i've been using the control to paste together 2
rtf
> > files in a recent project.
> >
> > shaun
> >
> >
> >
> > ---------------------------------------
> > "Shaun Pow" wrote in message
> > news:wD8ETaSXDHA.2012@dynaweb.datadynamics.com...
> > >
> > > Eric,
> > >
> > > Maybe look at the Rich Edit control - might be an easy way to do it.
do a
> > > sample up in word and save it as a RTF file - open up the file and see
> > what
> > > coding is required. use the TextRTF property. might be easier than
> > > calculating the text size etc.
> > >
> > > Shaun
> > > --
> > > "Eric Law" wrote in message
> > > news:$VA#0UOXDHA.1896@dynaweb.datadynamics.com...
> > > > Hello all!
> > > >
> > > > I'm creating a report using ActiveReports 2 and VB6.
> > > >
> > > > What I need to do is, on the fly, position a field based on the
width of
> > > the text in an adjacent field.
> > > >
> > > > The report concerns stocks, and it's supposed to print the company
name
> > > (left-justified), and the ticker symbol immediately to the
> > > > right of the name in a different font. Because the fonts are
different,
> > I
> > > figure the thing to do is use separate fields for each
> > > > item. But the ticker field needs to be positioned on the fly so
it's
> > > always just to the right of the company name, the length of
> > > > which varies. I can't do a calculation like len(companyName)
because
> > it's
> > > a proportional font and the width of the text is not
> > > > entirely related to the number of characters.
> > > >
> > > > Any ideas?
> > > >
> > > > Eric Law
> > > > Weiss Ratings
> > > >
> > > >
> > >
> > >
> >
> >
>
>



   Report 
GrapeCity » Forum Archives » support.activer... » Re: Dynamic field positioning

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.