Pivot view Reload layout problem

Posted by: mouna1619 on 3 August 2017, 4:02 pm EST

  • Posted 3 August 2017, 4:02 pm EST

    Hello



    Everytime i change something on the pivotview, for ex altering a measure's expression, i reload the schema and reload the layout. i use the funtion this.pivotView1.Read(reader, PersistSettings.Layout);

    but this function is very slow. if i just refresh the pivotview, the layout settings are no longer there. is there a better way to do this without having to reload the layout everytime, so that the report runs faster.



    Here is my code :

    private void ReloadDataSourceSchema(SchemaDefinition schemaDefinition)

    {

    MemoryStream memoryStream = null;

    this.pivotView1.BeginInit();

    this.pivotView1.Cursor = Cursors.WaitCursor;

    try

    {

    if (this.pivotView1.AutoRefreshGrid)

    {

    ......

    ......

    .....

    // store the layout

    memoryStream = new MemoryStream();

    XmlWriter writer = XmlWriter.Create(memoryStream);

    this.pivotView1.Write(writer, PersistSettings.Layout);

    writer.Flush();



    ......

    ......

    ......



    // restore layout

    memoryStream.Position = 0;

    XmlReader reader = XmlReader.Create(memoryStream);

    this.pivotView1.Read(reader, PersistSettings.Layout);

    }



    }

    catch (InvalidLayoutException)

    {

    ......

    }

    finally

    {

    if (memoryStream != null)

    {

    memoryStream.Dispose();

    }



    this.pivotView1.Cursor = Cursors.Arrow;

    this.pivotView1.EndInit();

    }

    }
  • Replied 3 August 2017, 4:02 pm EST

    mouna1619,

    Could you please let me know which build of ActiveAnalysis are you using at the moment? What is the platform you are working with? If you are looking to provide auto refresh functionality within ActiveAnalysis, then you may want to check this blog post which provides another way of doing it.

    Regards,
    Sankalp
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels