Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: Does LimeReport createPreviewWidget Work?  (Read 542 times)

Proton Phoenix

  • Newbie
  • *
  • Posts: 15
    • View Profile
Does LimeReport createPreviewWidget Work?
« on: September 28, 2022, 10:52:10 PM »
Hi ~~~
i am trying to create an embedded widget but it doesn't work at all

Code: [Select]
LimeReport::ReportEngine *report=new LimeReport::ReportEngine(this);
report->loadFromFile(QDir::currentPath().append("/release/report/test1.lrxml"));
report->createPreviewWidget(ui->widget);

it's shows only this on QDebug output but nothing in QWidget
Quote
m_pagesize= LimeReport::PageItemDesignIntf::A4
initpagesizewidth= 2000
initpagesizeheight= 2870
m_pagesize= LimeReport::PageItemDesignIntf::A4

is there any solution?


« Last Edit: September 28, 2022, 10:54:33 PM by Proton Phoenix »

Subst

  • Sr. Member
  • ****
  • Posts: 444
    • View Profile
Re: Does LimeReport createPreviewWidget Work?
« Reply #1 on: September 30, 2022, 08:01:56 PM »
try this

Code: [Select]
LimeReport::ReportEngine *report=new LimeReport::ReportEngine(this);
report->loadFromFile(QDir::currentPath().append("/release/report/test1.lrxml"));
QWidget *previewWidget=report->createPreviewWidget(ui->widget);

qDebug()<<previewWidget->isVisible()<<previewWidget->size()<<<previewWidget->pos();

Proton Phoenix

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Does LimeReport createPreviewWidget Work?
« Reply #2 on: October 01, 2022, 09:25:35 PM »
Thank you so much bro <3 it works

Subst

  • Sr. Member
  • ****
  • Posts: 444
    • View Profile
Re: Does LimeReport createPreviewWidget Work?
« Reply #3 on: October 03, 2022, 07:17:49 AM »
Have u forgot to rize widget->show(); ?

Or widget->resize() & widget->move() helps?
« Last Edit: October 03, 2022, 07:19:34 AM by Subst »

Proton Phoenix

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Does LimeReport createPreviewWidget Work?
« Reply #4 on: November 23, 2022, 12:13:38 AM »
Have u forgot to rize widget->show(); ?

Or widget->resize() & widget->move() helps?

i did it like
previewWidget->setMaxmiumSize(ui->widget->size());
previewWidget->show();