Page 1 of 1

How to resize options form before running report

Posted: Mon Aug 02, 2010 3:58 pm
by ChrisMcD
Hello,

I have an option form that allows you to choose All clients with a checkbox and if you uncheck the All checkbox it display a list of the available clients in a listbox.

I would like to resize the form according to the state of the checkbox. I tried using this code:

Public Sub FormResize
If CheckBoxControl1.Checked = True Then
Form1.Size = New Size(300,300)
Else
Form1.Size = New Size(60,300)
End If
End Sub

I dont get an error and I checked, it is hitting the subroutine.
Is there an override i'm missing that will allow it to resize?

Thanks,

Chris


How to resize options form before running report

Posted: Mon Aug 02, 2010 4:29 pm
by Jan
Hello Chris,

You have used Dialogs from report? Can you send your report?

Thank you.

How to resize options form before running report

Posted: Mon Aug 02, 2010 4:37 pm
by ChrisMcD
Hi Jan,

Did you want me to email the report? Sorry a little unfamiliar with forums, I just copied everything in the Code Tab to this post. Is that enough information?

Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Data
Imports Stimulsoft.Controls
Imports Stimulsoft.Base.Drawing
Imports Stimulsoft.Report
Imports Stimulsoft.Report.Dialogs
Imports Stimulsoft.Report.Components

Namespace Reports

Public Class Report
Inherits Stimulsoft.Report.StiReport

Public Sub New()
MyBase.New
Me.InitializeComponent
End Sub

Public Sub FormResize
If CheckBoxControl1.Checked = True Then
Form1.Size = New Size(300,300)
TextBoxControl1.Text = "Check"
Else
Form1.Size = New Size(60,300)
TextBoxControl1.Text = "UnCheck"
End If
End Sub

#Region "StiReport Designer generated code - do not modify"
Public Page1 As Stimulsoft.Report.Components.StiPage
Public Page1_Watermark As Stimulsoft.Report.Components.StiWatermark
Public Form1 As Stimulsoft.Report.Dialogs.StiForm
Public CheckBoxControl1 As Stimulsoft.Report.Dialogs.StiCheckBoxControl
Public ListBoxControl1 As Stimulsoft.Report.Dialogs.StiListBoxControl
Public TextBoxControl1 As Stimulsoft.Report.Dialogs.StiTextBoxControl
Public Report_PrinterSettings As Stimulsoft.Report.Print.StiPrinterSettings

Public Sub CheckBoxControl1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
FormResize()
End Sub

Private Sub InitializeComponent()
Me.NeedsCompiling = false
Me.EngineVersion = Stimulsoft.Report.Engine.StiEngineVersion.EngineV2
Me.ReferencedAssemblies = New System.String() {"System.Dll", "System.Drawing.Dll", "System.Windows.Forms.Dll", "System.Data.Dll", "System.Xml.Dll", "Stimulsoft.Controls.Dll", "Stimulsoft.Base.Dll", "Stimulsoft.Report.Dll"}
Me.ReportAlias = "Report"
'
'ReportChanged
'
Me.ReportChanged = New DateTime(2010, 8, 2, 14, 24, 47, 469)
'
'ReportCreated
'
Me.ReportCreated = New DateTime(2010, 8, 2, 13, 49, 59, 149)
Me.ReportFile = "C:\Users\cmcdonou\Desktop\TestResizeReport.mrt"
Me.ReportGuid = "a823e89b522549d2899ceb2102a0af27"
Me.ReportName = "Report"
Me.ReportUnit = Stimulsoft.Report.StiReportUnitType.Inches
Me.ScriptLanguage = Stimulsoft.Report.StiReportLanguageType.VB
'
'Page1
'
Me.Page1 = New Stimulsoft.Report.Components.StiPage
Me.Page1.Guid = "475e182aca5846ab8cfa96f2c9de7395"
Me.Page1.Name = "Page1"
Me.Page1.PageHeight = 11.69
Me.Page1.PageWidth = 8.27
Me.Page1.Border = New Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.None, System.Drawing.Color.Black, 2, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black))
Me.Page1.Brush = New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent)
Me.Page1.ExcelSheetValue = Nothing
Me.Page1.Interaction = Nothing
Me.Page1.Margins = New Stimulsoft.Report.Components.StiMargins(0.39, 0.39, 0.39, 0.39)
Me.Page1_Watermark = New Stimulsoft.Report.Components.StiWatermark
Me.Page1_Watermark.Font = New System.Drawing.Font("Arial", 100!)
Me.Page1_Watermark.Image = Nothing
Me.Page1_Watermark.TextBrush = New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.FromArgb(50, 0, 0, 0))
'
'Form1
'
Me.Form1 = New Stimulsoft.Report.Dialogs.StiForm
Me.Form1.BackColor = System.Drawing.SystemColors.Control
Me.Form1.Guid = "c8bd2fd4466a491fb192c77e58c90685"
Me.Form1.Location = New System.Drawing.Point(0, 0)
Me.Form1.Name = "Form1"
Me.Form1.Size = New System.Drawing.Size(304, 64)
Me.Form1.Text = "Form1"
'
'CheckBoxControl1
'
Me.CheckBoxControl1 = New Stimulsoft.Report.Dialogs.StiCheckBoxControl
Me.CheckBoxControl1.BackColor = System.Drawing.SystemColors.Control
Me.CheckBoxControl1.ClientRectangle = New Stimulsoft.Base.Drawing.RectangleD(72, 8, 24, 16)
Me.CheckBoxControl1.ForeColor = System.Drawing.Color.Black
Me.CheckBoxControl1.Location = New System.Drawing.Point(72, 8)
Me.CheckBoxControl1.Name = "CheckBoxControl1"
Me.CheckBoxControl1.Size = New System.Drawing.Size(24, 16)
Me.CheckBoxControl1.Text = "Check Box"
Me.CheckBoxControl1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8!)
Me.CheckBoxControl1.Guid = Nothing
AddHandler Me.CheckBoxControl1.CheckedChanged, AddressOf Me.CheckBoxControl1_CheckedChanged
'
'ListBoxControl1
'
Me.ListBoxControl1 = New Stimulsoft.Report.Dialogs.StiListBoxControl
Me.ListBoxControl1.BackColor = System.Drawing.SystemColors.Window
Me.ListBoxControl1.ClientRectangle = New Stimulsoft.Base.Drawing.RectangleD(24, 64, 112, 96)
Me.ListBoxControl1.Location = New System.Drawing.Point(24, 64)
Me.ListBoxControl1.Name = "ListBoxControl1"
Me.ListBoxControl1.Size = New System.Drawing.Size(112, 96)
Me.ListBoxControl1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8!)
Me.ListBoxControl1.Guid = Nothing
'
'TextBoxControl1
'
Me.TextBoxControl1 = New Stimulsoft.Report.Dialogs.StiTextBoxControl
Me.TextBoxControl1.BackColor = System.Drawing.SystemColors.Window
Me.TextBoxControl1.ClientRectangle = New Stimulsoft.Base.Drawing.RectangleD(160, 8, 104, 20)
Me.TextBoxControl1.ForeColor = System.Drawing.Color.Black
Me.TextBoxControl1.Location = New System.Drawing.Point(160, 8)
Me.TextBoxControl1.Name = "TextBoxControl1"
Me.TextBoxControl1.Size = New System.Drawing.Size(104, 20)
Me.TextBoxControl1.Text = "Text Box"
Me.TextBoxControl1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8!)
Me.TextBoxControl1.Guid = Nothing
Me.Form1.ExcelSheetValue = Nothing
Me.Form1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8!)
Me.Report_PrinterSettings = New Stimulsoft.Report.Print.StiPrinterSettings
Me.PrinterSettings = me.Report_PrinterSettings
Me.Page1.Page = me.Page1
Me.Page1.Report = Me
Me.Page1.Watermark = me.Page1_Watermark
Me.Form1.Page = me.Form1
Me.Form1.Report = Me
Me.CheckBoxControl1.Page = me.Form1
Me.CheckBoxControl1.Parent = me.Form1
Me.ListBoxControl1.Page = me.Form1
Me.ListBoxControl1.Parent = me.Form1
Me.TextBoxControl1.Page = me.Form1
Me.TextBoxControl1.Parent = me.Form1
'
'Add to Form1.Components
'
Me.Form1.Components.Clear
Me.Form1.Components.AddRange(New Stimulsoft.Report.Components.StiComponent() {me.CheckBoxControl1, me.ListBoxControl1, me.TextBoxControl1})
'
'Add to Pages
'
Me.Pages.Clear
Me.Pages.AddRange(New Stimulsoft.Report.Components.StiPage() {me.Page1, me.Form1})
End Sub
#End Region 'StiReport Designer generated code - do not modify
End Class
End Namespace

Thanks,

Chris

How to resize options form before running report

Posted: Tue Aug 03, 2010 1:36 am
by Alex K.
Hello,

You need a little fix your code:

Code: Select all

If CheckBoxControl1.Checked = True Then
Form1.Control.Size = new Size (300,300)
TextBoxControl1.Text = "Check"
Else
Form1.Control.Size = new Size (60,300)
TextBoxControl1.Text = "UnCheck"
End If
Thank you.

How to resize options form before running report

Posted: Tue Aug 03, 2010 8:35 am
by ChrisMcD
That worked, thank you very much.

One thing I have noticed is that my mouse will not scroll in the code tab, is there a quick fix for that or would you like me to start another post?

Thanks,

Chris

How to resize options form before running report

Posted: Wed Aug 04, 2010 12:56 am
by Alex K.
Hello,


We couldn't reproduce this bug. Could you explain your issue in more details?
Which version of Stimulsoft Reports.Net do you use?

Thank you.

How to resize options form before running report

Posted: Wed Aug 04, 2010 8:48 am
by ChrisMcD
I'm using Stimulsoft Reports.Net Version 2010.1.700, and I have a microsoft wireless mouse 5000, running on Windows 7 64 bit. I know that the other programmers here also have that problem (different mice same OS). I originally had it for Version 2009 and downloaded the latest version to see if the problem went away.

The problem spefically happens when I am creating a report, if I go to the Code tab - the scrolling wheel will not scroll the code up and down, I need to grab the scrollbar to move through the code. One thing I noticed when I was trying to get a good description of the problem is that if I aim the mouse at the toolbar and scroll it does go through the 'Home' 'Page' 'Layout' and 'View' tabs.

Hope this helps.

Thanks,
Chris

How to resize options form before running report

Posted: Thu Aug 05, 2010 12:51 am
by Alex K.
Hello,

Sorry, but we couldn't reproduce this bug.
We will fix it if we would be able to reproduce it.

Thank you.