void __fastcall TMain_Form::InputData_UserDataSetGetValue(const AnsiString VarName, Variant &Value)
{
if (CompareText(VarName,"NoLayer") == 0) Value = LayersParam_StringGrid->Cells[0][InputData_UserDataSet->RecNo+1];
if (CompareText(VarName,"p_model") == 0) Value = LayersParam_StringGrid->Cells[1][InputData_UserDataSet->RecNo+1];
if (CompareText(VarName,"p") == 0) Value = LayersParam_StringGrid->Cells[2][InputData_UserDataSet->RecNo+1];
if (CompareText(VarName,"h_model") == 0) Value = LayersParam_StringGrid->Cells[3][InputData_UserDataSet->RecNo+1];
if (CompareText(VarName,"h") == 0) Value = LayersParam_StringGrid->Cells[4][InputData_UserDataSet->RecNo+1];
}
А на графики соответственно указать InputData_UserDataSet
х значение InputData_UserDataSet."p_model"
у значение InputData_UserDataSet."p"
токо Preview ничего не покажет
Комментарии
автор AlexTZ
Пример обработчика на BCB:
CODE
void __fastcall Tshet_faktura::frxReport1BeforePrint(
TfrxReportComponent *c)
{
TfrxCrossView* Cross;
//AnsiString pStrs[1];
//int pRows[1],pCols[1];
AnsiString s=c->ClassName();
//Variant vInteger(4);
if(s == "TfrxCrossView")
{
Cross = (TfrxCrossView*)c;
for (int i = 1;i<=16;i++)
{
for (int j = 1;j<=16;j++)
{
Variant pRows[] = {i};
Variant pCols[] = {j};
Variant pStrs[] = {"12345"};
int nSize = ARRAYSIZE(pStrs);
Caption = IntToStr(nSize);
Cross->AddValue((const Variant*)pRows,ARRAYSIZE(pRows)-1,
(const Variant*)pCols,ARRAYSIZE(pCols)-1,
(const Variant*)pStrs,ARRAYSIZE(pStrs)-1);
}
}
}
}
Может кто программировал с frxChartObject. Как ей воспользоваться? Или где можно о ней почитать
//====================================================void __fastcall TMain_Form::Print_ButtonClick(TObject *Sender)
{
InputData_UserDataSet->RangeEnd = reCount; InputData_UserDataSet->RangeEndCount = StrToInt(NumberLayers_Edit->Text) ;
InputData_Report->LoadFromFile("PrintReports\\inputdata1.fr3",false);
InputData_Report->ShowReport();
}
//
void __fastcall TMain_Form::InputData_UserDataSetGetValue(const AnsiString VarName, Variant &Value)
{
if (CompareText(VarName,"NoLayer") == 0) Value = LayersParam_StringGrid->Cells[0][InputData_UserDataSet->RecNo+1];
if (CompareText(VarName,"p_model") == 0) Value = LayersParam_StringGrid->Cells[1][InputData_UserDataSet->RecNo+1];
if (CompareText(VarName,"p") == 0) Value = LayersParam_StringGrid->Cells[2][InputData_UserDataSet->RecNo+1];
if (CompareText(VarName,"h_model") == 0) Value = LayersParam_StringGrid->Cells[3][InputData_UserDataSet->RecNo+1];
if (CompareText(VarName,"h") == 0) Value = LayersParam_StringGrid->Cells[4][InputData_UserDataSet->RecNo+1];
}
А на графики соответственно указать InputData_UserDataSet
х значение InputData_UserDataSet."p_model"
у значение InputData_UserDataSet."p"
токо Preview ничего не покажет