I was trying to make the code eaiser to read:
I want to be able to export two views one after the other, I want to define my export view via variable. Or type it in if possible.
like this.actionview("this view is going to pdf" + ,,,,,,)
Sorry for the double post, I don't know how to delete the first:
public void CTRL11_5_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
{
// declare variables:
string fileName;
XPathNavigator nameNode;
string viewName = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:view2", NamespaceManager).Value;
nameNode = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:field1", NamespaceManager);
fileName = nameNode.Value + ".pdf";
MessageBox.Show("Loading the view: " + this.CurrentView.ViewInfo.Name);
MessageBox.Show(this.CurrentView.ViewInfo.Name);
MessageBox.Show(this.CurrentView.Window.Caption);
MessageBox.Show("Going to: " + viewName);// Jumping to new view for exporting
ViewInfos.SwitchView(viewName);
// attempt to use a variable and export to pdf. Trying to replace current with variable viewname
//Do the work -- notice we use the variable fileName as part of the path for the file.
//this.viewName.Export(@"C:\moc\" + fileName, ExportFormat.Pdf);
}
}
public void CTRL4_9_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
string viewName3 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:View3", NamespaceManager).Value;
MessageBox.Show("Going to: " + viewName3);// Jumping to new view for exporting
ViewInfos.SwitchView(viewName3);
}