Image resolution with RSReport

Hello , let me introduce myself , I’m Nicola and I am a new user of XOJO .

I have searched in the forum and I have found nothing.

Recently for a project I was confronted with the problem of printing the report and its export to PDF, These are the problems I encountered and my solutions.

Using RSReport I was confronted with the problem of printing images considering them as rows , to be able to print a variable number per page .

The problem that arises if the image is larger than it needs to be printed , is sized correctly, but the “MMToPixel ( imageROW.Height_MM )” returns the actual size of the image and not the scaling dimension , getting high the calculation of that line .

The first solution to solve this problem is to resize manually the image, but the image appears in low resolution.

The best solution I’ve found is to change the PPI of the image to set the exact size using a high resolution image for a good printing result .

This is the code that I wrote:


Function imgPPIchange (img as Picture,Wmm as double,Hmm as double) as Picture
  
  Dim V,PPI,WI,V1 as Double
  Dim PPM as UInt16
  WI=img.Width
  V=WI/Wmm
  V1=img.Height/Hmm
  
  if V<V1 then V=V1
  
  V=V*1000
  PPM=Ceil(V)
  PPI=PPM/39.3701

'http://en.wikipedia.org/wiki/BMP_file_format
'In Example1 Table -> Offset 26h and 2Ah

  dim mb as MemoryBlock
  mb=img.GetData(img.FormatBMP,-1)
  
  dim B1 as byte
  dim B2 as byte
  
  B1 = Bitwise.ShiftRight(PPM,8)
  B2 = Bitwise.BitAnd(PPM,255)
  
  mb.Byte(38)=B2
  mb.Byte(39)=B1
  mb.Byte(40)=0
  mb.Byte(41)=0
  mb.Byte(42)=B2
  mb.Byte(43)=B1
  mb.Byte(44)=0
  mb.Byte(45)=0
  Dim oPicture as Picture
  oPicture = Picture.FromData (mb)
  Return oPicture

Sorry for my english, but I use a translator
I hope I was clear

Hi Nicola:

could you integrate lhf files? I`m using the rothsoft RSreport Designer to design my report but I have not been able to integrate it into my project. The idea is populate the report designed (lhf file saved) with MySql data. Could you help me with that? (any code or tutorial)

Thanks!!!

Hi Alvaro

RSReport is not straightforward to use, if you want a report with Visual design and populate with a SQL query.
I suggest try Bernardo Monsalve DBReport .

If you want to try RSReport can get the example at http://www.rothsoft.ch/realbasic/rsreport/index.php?page=downloads

And look at the classes in Demo-> Reports-> RSReportDesinger

If in doubt, ask as well.
I’ll answer if I will be able

thanks Nicola… I will try Bernardo Monsalve DBReport … I have been trying to figure out how the RSReportDesinger classes works, but it is too much complicated to my level of knowledge.

thanks again!!!