Adding FastCube object in code
I have a tool that allows customers to design FastReports over one or more queries. When I create the report, the code does something like:
Everything works great, the user is able to select fields from each query - I don't allow them to add their own data sources within FastReport so the Data tab is blank (they can only with the queries that the tool has control over).
Now I want to enhance the tool to allow a FastCube to be designed over each query. Sometimes a customer might want to run the cube just by itself, but they might also want to embed it onto a report. There doesn't seem to be anyway to add the cube (really a TfcGrid with it's schema/slice that the user has already designed) to a report - I would like to do something like
...so the Cube reference will appear in the Cube combobox when they drop a TfrcCrossView object onto the report.
I tried to do something like this to "pre-create" the object on the data tab:
...but that causes an "Invalid pointer error". What can I do to get the Report designer to show a FastCube that has already been designed? FastReport VCL version 4.10.1, FastCube version 1.8.4.
rptReport.Datasets.Add(rptDataset);
Everything works great, the user is able to select fields from each query - I don't allow them to add their own data sources within FastReport so the Data tab is blank (they can only with the queries that the tool has control over).
Now I want to enhance the tool to allow a FastCube to be designed over each query. Sometimes a customer might want to run the cube just by itself, but they might also want to embed it onto a report. There doesn't seem to be anyway to add the cube (really a TfcGrid with it's schema/slice that the user has already designed) to a report - I would like to do something like
rptReport.Cubes.Add(cubeReference);
...so the Cube reference will appear in the Cube combobox when they drop a TfrcCrossView object onto the report.
I tried to do something like this to "pre-create" the object on the data tab:
cubeView:=TfrcCube.Create(nil);
cubeView.Cube:=designedCube;
cubeView.Dataset:=rptDataset;
rptReport.Pages[0] as TfrxDataPage.Objects.Add(cubeView);
...but that causes an "Invalid pointer error". What can I do to get the Report designer to show a FastCube that has already been designed? FastReport VCL version 4.10.1, FastCube version 1.8.4.