Shift Object Position.frx 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Report ScriptLanguage="CSharp" ReportInfo.Description="Demonstrates how to handle an object's position in a script. To create such a report:&#13;&#10;- select the object you want to modify;&#13;&#10;- go to the Properties window and press the &quot;Events&quot; button;&#13;&#10;- doubleclick the BeforePrint event. This will create an empty event handler;&#13;&#10;- modify the object's Left property in the handler's code." ReportInfo.Created="05/29/2008 19:24:54" ReportInfo.Modified="03/30/2023 02:30:00" ReportInfo.CreatorVersion="1.0.0.0">
  3. <ScriptText>using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Windows.Forms;
  8. using System.Drawing;
  9. using System.Data;
  10. using FastReport;
  11. using FastReport.Data;
  12. using FastReport.Dialog;
  13. using FastReport.Barcode;
  14. using FastReport.Table;
  15. using FastReport.Utils;
  16. namespace FastReport
  17. {
  18. public class ReportScript
  19. {
  20. private int left = 0;
  21. private void Text1_BeforePrint(object sender, EventArgs e)
  22. {
  23. Text1.Left = left;
  24. left += 30;
  25. }
  26. }
  27. }
  28. </ScriptText>
  29. <Styles>
  30. <Style Name="EvenRows" Fill.Color="200, 160, 120" Font="Arial, 10pt"/>
  31. </Styles>
  32. <Dictionary>
  33. <TableDataSource Name="Categories" ReferenceName="NorthWind.Categories" DataType="System.Int32" Enabled="true">
  34. <Column Name="CategoryID" DataType="System.Int32"/>
  35. <Column Name="CategoryName" DataType="System.String"/>
  36. <Column Name="Description" DataType="System.String"/>
  37. <Column Name="Picture" DataType="System.Byte[]" BindableControl="Picture"/>
  38. </TableDataSource>
  39. </Dictionary>
  40. <ReportPage Name="Page1" Watermark.Font="Arial, 60pt">
  41. <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8" CanGrow="true">
  42. <TextObject Name="Text2" Width="718.2" Height="37.8" Text="CATEGORIES" HorzAlign="Center" VertAlign="Center" Font="Segoe UI, 14pt, style=Bold"/>
  43. </ReportTitleBand>
  44. <DataBand Name="Data1" Top="39.8" Width="718.2" Height="37.8" DataSource="Categories">
  45. <TextObject Name="Text1" Width="311.85" Height="37.8" Fill.Color="130, 180, 130" EvenStyle="EvenRows" BeforePrintEvent="Text1_BeforePrint" Text="[Categories.CategoryName]" VertAlign="Center" Font="Segoe UI, 12pt, style=Bold" TextFill.Color="White"/>
  46. </DataBand>
  47. <PageFooterBand Name="PageFooter1" Top="79.6" Width="718.2" Height="28.35" Fill.Color="WhiteSmoke">
  48. <TextObject Name="Text12" Left="9.45" Width="217.35" Height="28.35" Cursor="Hand" Hyperlink.Value="https://www.fast-report.com/en/product/fast-report-net/" Text="Generated by FastReport" VertAlign="Center" Font="Segoe UI, 9pt, style=Underline" TextFill.Color="Blue"/>
  49. </PageFooterBand>
  50. </ReportPage>
  51. </Report>