I am trying to convert a wpf application into mvc. In wpf, I used flowdocuments to write down the result of the calculations, and displayed them in a flowdocumentScrollViewer.
Following is the flowdocument:
private void Result() { fd = new FlowDocument(); fd.Blocks.Add(MyFD.heading1("Shell Calculations")); fd.Background = System.Windows.Media.Brushes.White; fd.ColumnWidth = 794; System.Windows.Documents.Table tb = new Table(); tb.CellSpacing = 0; tb.BorderThickness = new System.Windows.Thickness(1, 1, 0, 0); tb.BorderBrush = System.Windows.Media.Brushes.Green; tb.Columns.Add(new TableColumn() { Width = new System.Windows.GridLength(200) }); tb.Columns.Add(new TableColumn() { Width = new System.Windows.GridLength(100) }); tb.Columns.Add(new TableColumn() { Width = new System.Windows.GridLength(100) }); fd.Blocks.Add(tb); tb.RowGroups.Add(new TableRowGroup()); string lengthUnit = System.Windows.Application.Current.Resources["length"].ToString(); string stressUnit = System.Windows.Application.Current.Resources["stress"].ToString(); tb.RowGroups[0].Rows.Add(MyFD.r("Nominal thickness", s.en.ToString(), lengthUnit)); tb.RowGroups[0].Rows.Add(MyFD.r("Shell OD", s.Do.ToString(), lengthUnit)); tb.RowGroups[0].Rows.Add(MyFD.r("Length", s.L.ToString(), lengthUnit)); tb.RowGroups[0].Rows.Add(MyFD.r("Tolerance", s.tol.ToString(), "")); tb.RowGroups[0].Rows.Add(MyFD.r(new int[] { 3 }, "")); tb.RowGroups[0].Rows.Add(MyFD.r(new int[] { 3 }, "Result")); tb.RowGroups[0].Rows.Add(MyFD.r("Minimum Thickness", eMin.ToString("0.##"), lengthUnit)); tb.RowGroups[0].Rows.Add(MyFD.r("Rm", Rm.ToString(), stressUnit)); tb.RowGroups[0].Rows.Add(MyFD.r("Rp0.2", Rp02.ToString(), stressUnit)); tb.RowGroups[0].Rows.Add(MyFD.r("Rp1.0", Rp1.ToString(), stressUnit)); tb.RowGroups[0].Rows.Add(MyFD.r("Shell nominal design stress", fE.ToString("0.##"), stressUnit)); }
How can I do the same thing in asp.net mvc?