Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 28687

Update the Report Definition Programmatically : textbox properties with C#

$
0
0

Hello,

I'm trying to use http://msdn.microsoft.com/en-us/library/aa337390.aspx to update my report.

 List<ItemsChoiceType118> _reportItems = 
        new List<ItemsChoiceType118>(_report.ItemsElementName);

    // Locate the index for the Description property
    int index = _reportItems.IndexOf(
        ItemsChoiceType118.Description);

    // The Description item is of type StringLocIDType, so 
    // cast the item type first and then assign new value.
    System.Console.WriteLine("- Old Description: " + 
        ((StringLocIDType)_report.Items[index]).Value );

    // Update the Description for the Report
    ((StringLocIDType)_report.Items[index]).Value = 
        "New Report Description";

I managed to update the Description of the report but now I would like to access Textbox properties. How to do change the location for instance (Left or top value) ?

Many thanks :)

Alan

XML for the textbox :

...<Textbox Name="Textbox1"><CanGrow>true</CanGrow><KeepTogether>true</KeepTogether><Paragraphs><Paragraph><TextRuns><TextRun><Value>Texte</Value><Style /></TextRun></TextRuns><Style /></Paragraph></Paragraphs><Top>11.21833mm</Top><Left>114.7mm</Left><Height>6mm</Height><Width>25mm</Width><ZIndex>2</ZIndex><Style><Border><Style>None</Style></Border><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom></Style></Textbox></ReportItems>


Viewing all articles
Browse latest Browse all 28687